mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-06 22:52:44 +00:00
Bug 873963 - Set fontFamily property directly; r=dcamp, mgoodwin
This commit is contained in:
parent
08bfd84263
commit
342dbaef36
@ -183,7 +183,6 @@ FontInspector.prototype = {
|
|||||||
*/
|
*/
|
||||||
let extraCSS = "* {padding:0;margin:0}";
|
let extraCSS = "* {padding:0;margin:0}";
|
||||||
extraCSS += ".theme-dark {color: white}";
|
extraCSS += ".theme-dark {color: white}";
|
||||||
extraCSS += "p {font-family: '" + name + "';}";
|
|
||||||
extraCSS += "p {font-size: 40px;line-height:60px;padding:0 10px;margin:0;}";
|
extraCSS += "p {font-size: 40px;line-height:60px;padding:0 10px;margin:0;}";
|
||||||
cssCode += extraCSS;
|
cssCode += extraCSS;
|
||||||
let src = "data:text/html;charset=utf-8,<!DOCTYPE HTML><head><base></base></head><style></style><p contenteditable>Abc</p>";
|
let src = "data:text/html;charset=utf-8,<!DOCTYPE HTML><head><base></base></head><style></style><p contenteditable>Abc</p>";
|
||||||
@ -194,6 +193,7 @@ FontInspector.prototype = {
|
|||||||
// nightmare.
|
// nightmare.
|
||||||
doc.querySelector("base").href = base;
|
doc.querySelector("base").href = base;
|
||||||
doc.querySelector("style").textContent = cssCode;
|
doc.querySelector("style").textContent = cssCode;
|
||||||
|
doc.querySelector("p").style.fontFamily = name;
|
||||||
// Forward theme
|
// Forward theme
|
||||||
doc.documentElement.className = document.documentElement.className;
|
doc.documentElement.className = document.documentElement.className;
|
||||||
}, true);
|
}, true);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="template" style="display:none">
|
<div id="template" style="display:none">
|
||||||
<section class="font">
|
<section class="font">
|
||||||
<iframe sandbox="allow-same-origin" class="font-preview"></iframe>
|
<iframe sandbox="" class="font-preview"></iframe>
|
||||||
<div class="font-info">
|
<div class="font-info">
|
||||||
<h1 class="font-name"></h1>
|
<h1 class="font-name"></h1>
|
||||||
<span class="font-is-local">&system;</span>
|
<span class="font-is-local">&system;</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user