Diff
Modified: branches/safari-602-branch/LayoutTests/ChangeLog (207746 => 207747)
--- branches/safari-602-branch/LayoutTests/ChangeLog 2016-10-24 07:18:43 UTC (rev 207746)
+++ branches/safari-602-branch/LayoutTests/ChangeLog 2016-10-24 07:18:47 UTC (rev 207747)
@@ -1,5 +1,20 @@
2016-10-20 Matthew Hanson <matthew_han...@apple.com>
+ Merge r207275. rdar://problem/28810752
+
+ 2016-10-12 Zalan Bujtas <za...@apple.com>
+
+ RenderRubyRun should not mark child renderers dirty at the end of layout.
+ https://bugs.webkit.org/show_bug.cgi?id=163359
+ <rdar://problem/28711840>
+
+ Reviewed by David Hyatt.
+
+ * fast/ruby/rubyrun-has-bad-child-expected.txt: Added.
+ * fast/ruby/rubyrun-has-bad-child.html: Added.
+
+2016-10-20 Matthew Hanson <matthew_han...@apple.com>
+
Merge r207274. rdar://problem/28849629
2016-10-12 Simon Fraser <simon.fra...@apple.com>
Added: branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child-expected.txt (0 => 207747)
--- branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child-expected.txt (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child-expected.txt 2016-10-24 07:18:47 UTC (rev 207747)
@@ -0,0 +1,2 @@
+PASS if no crash or assert in debug. r foobarfoobar
+
Added: branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child.html (0 => 207747)
--- branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child.html (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/ruby/rubyrun-has-bad-child.html 2016-10-24 07:18:47 UTC (rev 207747)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can rendere ruby with text-align justified properly.</title>
+<style>
+body {
+ text-align: justify;
+ font: 150px Litherum;
+}
+</style>
+</head>
+<body>
+PASS if no crash or assert in debug.
+<ruby><rb>r</rb>
+ <canvas id=canvasId></canvas></ruby>
+foobarfoobar<ruby><rt id=rtId></rt></ruby><div id=divId></div>
+</body>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+var rt = document.getElementById("rtId");
+var canvas = document.getElementById("canvasId");
+rt.parentNode.removeChild(rt);
+canvas.parentNode.insertBefore(rt, canvas);
+</script>
+</html>
Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207746 => 207747)
--- branches/safari-602-branch/Source/WebCore/ChangeLog 2016-10-24 07:18:43 UTC (rev 207746)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog 2016-10-24 07:18:47 UTC (rev 207747)
@@ -1,5 +1,30 @@
2016-10-20 Matthew Hanson <matthew_han...@apple.com>
+ Merge r207275. rdar://problem/28810752
+
+ 2016-10-12 Zalan Bujtas <za...@apple.com>
+
+ RenderRubyRun should not mark child renderers dirty at the end of layout.
+ https://bugs.webkit.org/show_bug.cgi?id=163359
+ <rdar://problem/28711840>
+
+ Reviewed by David Hyatt.
+
+ The current layout logic does not support marking renderers dirty for subsequent layouts.
+ Layout needs to exit with a clean tree.
+ Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
+
+ Test: fast/ruby/rubyrun-has-bad-child.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
+ * rendering/RenderRubyRun.cpp:
+ (WebCore::RenderRubyRun::layout):
+ (WebCore::RenderRubyRun::layoutBlock):
+ * rendering/RenderRubyRun.h:
+
+2016-10-20 Matthew Hanson <matthew_han...@apple.com>
+
Merge r207274. rdar://problem/28849629
2016-10-12 Simon Fraser <simon.fra...@apple.com>
Modified: branches/safari-602-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp (207746 => 207747)
--- branches/safari-602-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2016-10-24 07:18:43 UTC (rev 207746)
+++ branches/safari-602-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2016-10-24 07:18:47 UTC (rev 207747)
@@ -581,12 +581,6 @@
rubyRun.clearOverrideLogicalContentWidth();
r.box()->setExpansion(newRubyRunWidth - r.box()->logicalWidth());
- // This relayout caused the size of the RenderRubyText and the RenderRubyBase to change, dependent on the line's current expansion. Next time we relayout the
- // RenderRubyRun, make sure that we relayout the RenderRubyBase and RenderRubyText as well.
- rubyBase.setNeedsLayout(MarkOnlyThis);
- if (RenderRubyText* rubyText = rubyRun.rubyText())
- rubyText->setNeedsLayout(MarkOnlyThis);
-
totalLogicalWidth += totalExpansion;
expansionOpportunityCount -= totalOpportunitiesInRun;
}
Modified: branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.cpp (207746 => 207747)
--- branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.cpp 2016-10-24 07:18:43 UTC (rev 207746)
+++ branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.cpp 2016-10-24 07:18:47 UTC (rev 207747)
@@ -235,15 +235,26 @@
{
if (RenderRubyBase* base = rubyBase())
base->reset();
+ RenderBlockFlow::layout();
+}
- RenderBlockFlow::layout();
-
+void RenderRubyRun::layoutBlock(bool relayoutChildren, LayoutUnit pageHeight)
+{
+ if (!relayoutChildren) {
+ // Since the extra relayout in RenderBlockFlow::updateRubyForJustifiedText() causes the size of the RenderRubyText/RenderRubyBase
+ // dependent on the line's current expansion, whenever we relayout the RenderRubyRun, we need to relayout the RenderRubyBase/RenderRubyText as well.
+ // FIXME: We should take the expansion opportunities into account if possible.
+ relayoutChildren = style().textAlign() == JUSTIFY;
+ }
+
+ RenderBlockFlow::layoutBlock(relayoutChildren, pageHeight);
+
RenderRubyText* rt = rubyText();
if (!rt)
return;
rt->setLogicalLeft(0);
-
+
// Place the RenderRubyText such that its bottom is flush with the lineTop of the first line of the RenderRubyBase.
LayoutUnit lastLineRubyTextBottom = rt->logicalHeight();
LayoutUnit firstLineRubyTextTop = 0;
Modified: branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.h (207746 => 207747)
--- branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.h 2016-10-24 07:18:43 UTC (rev 207746)
+++ branches/safari-602-branch/Source/WebCore/rendering/RenderRubyRun.h 2016-10-24 07:18:47 UTC (rev 207747)
@@ -55,6 +55,7 @@
RenderObject* layoutSpecialExcludedChild(bool relayoutChildren) override;
void layout() override;
+ void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0) override;
bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;