Title: [202127] trunk
- Revision
- 202127
- Author
- [email protected]
- Date
- 2016-06-16 10:10:38 -0700 (Thu, 16 Jun 2016)
Log Message
Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
https://bugs.webkit.org/show_bug.cgi?id=158297
Reviewed by Darin Adler.
Source/WebCore:
In an effort to reduce the flash of unstyled content, we force all elements
to have display: none during an external stylesheet load. We do this by
ignoring the CSS cascade and forcing all elements to have a placeholder style
which hardcodes display: none. (This is necessary to make elements created by
script during the stylesheet load not flash.)
This style is exposed to web content via getComputedStyle(), which means it
needs to maintain the invariant that font-families can never be null strings.
We enforce this by forcing the font-family to be the standard font name.
Test: fast/text/placeholder-renderstyle-null-font.html
* style/StyleTreeResolver.cpp:
(WebCore::Style::ensurePlaceholderStyle):
LayoutTests:
* fast/text/placeholder-renderstyle-null-font-expected.txt: Added.
* fast/text/placeholder-renderstyle-null-font.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (202126 => 202127)
--- trunk/LayoutTests/ChangeLog 2016-06-16 16:32:04 UTC (rev 202126)
+++ trunk/LayoutTests/ChangeLog 2016-06-16 17:10:38 UTC (rev 202127)
@@ -1,3 +1,13 @@
+2016-06-16 Myles C. Maxfield <[email protected]>
+
+ Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
+ https://bugs.webkit.org/show_bug.cgi?id=158297
+
+ Reviewed by Darin Adler.
+
+ * fast/text/placeholder-renderstyle-null-font-expected.txt: Added.
+ * fast/text/placeholder-renderstyle-null-font.html: Added.
+
2016-06-15 Keith Miller <[email protected]>
Add support for Symbol.isConcatSpreadable (round 2)
Added: trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font-expected.txt (0 => 202127)
--- trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font-expected.txt 2016-06-16 17:10:38 UTC (rev 202127)
@@ -0,0 +1 @@
+This test makes sure that placeholder RenderStyles that we use during external stylesheet loads have a non-null font family. The test passes if there is no crash.
Added: trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font.html (0 => 202127)
--- trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font.html (rev 0)
+++ trunk/LayoutTests/fast/text/placeholder-renderstyle-null-font.html 2016-06-16 17:10:38 UTC (rev 202127)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html id="htmlElement">
+<head>
+<script>
+</script>
+</head>
+<body>
+This test makes sure that placeholder RenderStyles that we use during external stylesheet loads have a non-null font family. The test passes if there is no crash.
+<svg id="target"></svg>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+document.getElementById("htmlElement").offsetTop;
+
+var link = document.createElement("link");
+link.rel = "stylesheet";
+link.href = ""
+document.head.appendChild(link);
+
+var groupNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
+groupNode.style.display = "none";
+var target = document.getElementById("target");
+target.appendChild(groupNode);
+window.getComputedStyle(groupNode).fontFamily;
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (202126 => 202127)
--- trunk/Source/WebCore/ChangeLog 2016-06-16 16:32:04 UTC (rev 202126)
+++ trunk/Source/WebCore/ChangeLog 2016-06-16 17:10:38 UTC (rev 202127)
@@ -1,3 +1,25 @@
+2016-06-16 Myles C. Maxfield <[email protected]>
+
+ Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
+ https://bugs.webkit.org/show_bug.cgi?id=158297
+
+ Reviewed by Darin Adler.
+
+ In an effort to reduce the flash of unstyled content, we force all elements
+ to have display: none during an external stylesheet load. We do this by
+ ignoring the CSS cascade and forcing all elements to have a placeholder style
+ which hardcodes display: none. (This is necessary to make elements created by
+ script during the stylesheet load not flash.)
+
+ This style is exposed to web content via getComputedStyle(), which means it
+ needs to maintain the invariant that font-families can never be null strings.
+ We enforce this by forcing the font-family to be the standard font name.
+
+ Test: fast/text/placeholder-renderstyle-null-font.html
+
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::ensurePlaceholderStyle):
+
2016-06-16 Chris Dumez <[email protected]>
Avoid some temporary String allocations for common HTTP headers in ResourceResponse::platformLazyInit()
Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (202126 => 202127)
--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2016-06-16 16:32:04 UTC (rev 202126)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp 2016-06-16 17:10:38 UTC (rev 202127)
@@ -43,6 +43,7 @@
#include "PlatformStrategies.h"
#include "Settings.h"
#include "ShadowRoot.h"
+#include "StyleFontSizeFunctions.h"
#include "StyleResolver.h"
#include "Text.h"
@@ -63,6 +64,15 @@
placeholderStyle = RenderStyle::createPtr().release();
placeholderStyle->setDisplay(NONE);
placeholderStyle->setIsPlaceholderStyle();
+
+ FontCascadeDescription fontDescription;
+ fontDescription.setOneFamily(standardFamily);
+ fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
+ float size = Style::fontSizeForKeyword(CSSValueMedium, false, document);
+ fontDescription.setSpecifiedSize(size);
+ fontDescription.setComputedSize(size);
+ placeholderStyle->setFontDescription(fontDescription);
+
placeholderStyle->fontCascade().update(&document.fontSelector());
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes