Diff
Modified: trunk/LayoutTests/ChangeLog (223687 => 223688)
--- trunk/LayoutTests/ChangeLog 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/LayoutTests/ChangeLog 2017-10-19 13:11:05 UTC (rev 223688)
@@ -1,3 +1,15 @@
+2017-10-19 Antti Koivisto <[email protected]>
+
+ Overlapping text on all CSS fonts specs
+ https://bugs.webkit.org/show_bug.cgi?id=177585
+ <rdar://problem/34704078>
+
+ Reviewed by Daniel Bates.
+
+ * fast/html/details-line-height-overlap-expected.html: Added.
+ * fast/html/details-line-height-overlap.html: Added.
+ * platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt:
+
2017-10-18 Ryosuke Niwa <[email protected]>
Don't expose raw HTML in pasteboard to the web content
Added: trunk/LayoutTests/fast/html/details-line-height-overlap-expected.html (0 => 223688)
--- trunk/LayoutTests/fast/html/details-line-height-overlap-expected.html (rev 0)
+++ trunk/LayoutTests/fast/html/details-line-height-overlap-expected.html 2017-10-19 13:11:05 UTC (rev 223688)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<style>
+html {
+ font-size: 15px;
+}
+li {
+ line-height: 15px;
+}
+</style>
+<details><summary>details</summary></details>
+<li>1 should not</li>
+<li>2 overlap</li>
Added: trunk/LayoutTests/fast/html/details-line-height-overlap.html (0 => 223688)
--- trunk/LayoutTests/fast/html/details-line-height-overlap.html (rev 0)
+++ trunk/LayoutTests/fast/html/details-line-height-overlap.html 2017-10-19 13:11:05 UTC (rev 223688)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<style>
+html {
+ font-size: 15px;
+}
+li {
+ line-height: 1rem;
+}
+</style>
+<details><summary>details</summary></details>
+<li>1 should not</li>
+<li>2 overlap</li>
Modified: trunk/LayoutTests/platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt (223687 => 223688)
--- trunk/LayoutTests/platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/LayoutTests/platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt 2017-10-19 13:11:05 UTC (rev 223688)
@@ -1,7 +1,7 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x140
- RenderBlock {HTML} at (0,0) size 800x140
+layer at (0,0) size 800x148
+ RenderBlock {HTML} at (0,0) size 800x148
RenderBody {BODY} at (8,16) size 784x116
RenderBlock {P} at (0,0) size 784x40
RenderText {#text} at (0,0) size 330x19
Modified: trunk/Source/WebCore/ChangeLog (223687 => 223688)
--- trunk/Source/WebCore/ChangeLog 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/Source/WebCore/ChangeLog 2017-10-19 13:11:05 UTC (rev 223688)
@@ -1,3 +1,32 @@
+2017-10-19 Antti Koivisto <[email protected]>
+
+ Overlapping text on all CSS fonts specs
+ https://bugs.webkit.org/show_bug.cgi?id=177585
+ <rdar://problem/34704078>
+
+ Reviewed by Daniel Bates.
+
+ We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
+ This resulted in 'rem' units being miscomputed.
+
+ Reduction by Zalan.
+
+ Test: fast/html/details-line-height-overlap.html
+
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::TreeResolver::Scope::Scope):
+ (WebCore::Style::TreeResolver::Scope::~Scope):
+
+ Only reset overrideDocumentElementStyle when destroying the scope.
+
+ (WebCore::Style::TreeResolver::pushScope):
+ (WebCore::Style::TreeResolver::pushEnclosingScope):
+ (WebCore::Style::TreeResolver::popScope):
+
+ A scope can show up multiple times in scope stack.
+
+ * style/StyleTreeResolver.h:
+
2017-10-19 Ryosuke Niwa <[email protected]>
Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
Modified: trunk/Source/WebCore/css/StyleResolver.h (223687 => 223688)
--- trunk/Source/WebCore/css/StyleResolver.h 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/Source/WebCore/css/StyleResolver.h 2017-10-19 13:11:05 UTC (rev 223688)
@@ -153,6 +153,7 @@
const MediaQueryEvaluator& mediaQueryEvaluator() const { return m_mediaQueryEvaluator; }
+ RenderStyle* overrideDocumentElementStyle() const { return m_overrideDocumentElementStyle; }
void setOverrideDocumentElementStyle(RenderStyle* style) { m_overrideDocumentElementStyle = style; }
void addCurrentSVGFontFaceRules();
Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (223687 => 223688)
--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp 2017-10-19 13:11:05 UTC (rev 223688)
@@ -75,8 +75,14 @@
, shadowRoot(&shadowRoot)
, enclosingScope(&enclosingScope)
{
+ styleResolver.setOverrideDocumentElementStyle(enclosingScope.styleResolver.overrideDocumentElementStyle());
}
+TreeResolver::Scope::~Scope()
+{
+ styleResolver.setOverrideDocumentElementStyle(nullptr);
+}
+
TreeResolver::Parent::Parent(Document& document)
: element(nullptr)
, style(*document.renderStyle())
@@ -93,7 +99,6 @@
void TreeResolver::pushScope(ShadowRoot& shadowRoot)
{
m_scopeStack.append(adoptRef(*new Scope(shadowRoot, scope())));
- scope().styleResolver.setOverrideDocumentElementStyle(m_documentElementStyle.get());
}
void TreeResolver::pushEnclosingScope()
@@ -100,12 +105,10 @@
{
ASSERT(scope().enclosingScope);
m_scopeStack.append(*scope().enclosingScope);
- scope().styleResolver.setOverrideDocumentElementStyle(m_documentElementStyle.get());
}
void TreeResolver::popScope()
{
- scope().styleResolver.setOverrideDocumentElementStyle(nullptr);
return m_scopeStack.removeLast();
}
Modified: trunk/Source/WebCore/style/StyleTreeResolver.h (223687 => 223688)
--- trunk/Source/WebCore/style/StyleTreeResolver.h 2017-10-19 10:34:31 UTC (rev 223687)
+++ trunk/Source/WebCore/style/StyleTreeResolver.h 2017-10-19 13:11:05 UTC (rev 223688)
@@ -68,6 +68,7 @@
Scope(Document&);
Scope(ShadowRoot&, Scope& enclosingScope);
+ ~Scope();
};
struct Parent {