Changeset 200220 in webkit
- Timestamp:
- Apr 28, 2016, 6:11:17 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r200216 r200220 1 2016-04-28 Zalan Bujtas <zalan@apple.com> 2 3 Content disappears on mouse over. 4 https://bugs.webkit.org/show_bug.cgi?id=157073 5 <rdar://problem/24389168> 6 7 Reviewed by Simon Fraser. 8 9 When a redundant inlinebox is found after constructing the line, we remove it from the tree. 10 The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean). 11 This patch resets this dirty flag on the boxes all the way up to the rootlinebox. 12 Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes. 13 14 * fast/text/text-node-remains-dirty-after-calling-surroundContents-expected.html: Added. 15 * fast/text/text-node-remains-dirty-after-calling-surroundContents.html: Added. 16 1 17 2016-04-27 Brent Fulgham <bfulgham@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r200219 r200220 1 2016-04-28 Zalan Bujtas <zalan@apple.com> 2 3 Content disappears on mouse over. 4 https://bugs.webkit.org/show_bug.cgi?id=157073 5 <rdar://problem/24389168> 6 7 Reviewed by Simon Fraser. 8 9 When a redundant inlinebox is found after constructing the line, we remove it from the tree. 10 The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean). 11 This patch resets this dirty flag on the boxes all the way up to the rootlinebox. 12 Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes. 13 14 Test: fast/text/text-node-remains-dirty-after-calling-surroundContents.html 15 16 * rendering/BidiRun.h: 17 (WebCore::BidiRun::setBox): 18 * rendering/RenderBlockFlow.h: 19 * rendering/RenderBlockLineLayout.cpp: 20 (WebCore::RenderBlockFlow::constructLine): 21 (WebCore::RenderBlockFlow::removeLineBoxIfNeeded): 22 (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): 23 * rendering/RenderBox.cpp: 24 (WebCore::RenderBox::positionLineBox): Deleted. 25 * rendering/RenderText.cpp: 26 (WebCore::RenderText::setText): 27 (WebCore::RenderText::positionLineBox): Deleted. 28 1 29 2016-04-28 John Wilander <wilander@apple.com> 2 30 -
trunk/Source/WebCore/rendering/BidiRun.h
r198970 r200220 42 42 RenderObject& renderer() { return m_renderer; } 43 43 InlineBox* box() { return m_box; } 44 void setBox(InlineBox & box) { m_box = &box; }44 void setBox(InlineBox* box) { m_box = box; } 45 45 46 46 private: -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r200162 r200220 605 605 void setSelectionState(SelectionState) final; 606 606 607 void removeInlineBox(BidiRun&, const RootInlineBox&) const; 608 607 609 public: 608 610 // FIXME-BLOCKFLOW: These can be made protected again once all callers have been moved here. -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r199149 r200220 294 294 295 295 InlineBox* box = createInlineBoxForRenderer(&r->renderer(), false, isOnlyRun); 296 r->setBox( *box);296 r->setBox(box); 297 297 298 298 if (!rootHasSelectedChildren && box->renderer().selectionState() != RenderObject::SelectionNone) … … 951 951 } 952 952 953 void RenderBlockFlow::removeInlineBox(BidiRun& run, const RootInlineBox& rootLineBox) const 954 { 955 auto* inlineBox = run.box(); 956 #if !ASSERT_DISABLED 957 auto* inlineParent = inlineBox->parent(); 958 while (inlineParent && inlineParent != &rootLineBox) { 959 ASSERT(!inlineParent->isDirty()); 960 inlineParent = inlineParent->parent(); 961 } 962 ASSERT(!rootLineBox.isDirty()); 963 #endif 964 auto* parent = inlineBox->parent(); 965 inlineBox->removeFromParent(); 966 967 auto& renderer = run.renderer(); 968 if (is<RenderText>(renderer)) 969 downcast<RenderText>(renderer).removeTextBox(downcast<InlineTextBox>(*inlineBox)); 970 delete inlineBox; 971 run.setBox(nullptr); 972 // removeFromParent() unnecessarily dirties the ancestor subtree. 973 auto* ancestor = parent; 974 while (ancestor) { 975 ancestor->markDirty(false); 976 if (ancestor == &rootLineBox) 977 break; 978 ancestor = ancestor->parent(); 979 } 980 } 981 953 982 void RenderBlockFlow::computeBlockDirectionPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, 954 983 VerticalPositionCache& verticalPositionCache) … … 957 986 958 987 // Now make sure we place replaced render objects correctly. 959 for ( BidiRun* run = firstRun; run; run = run->next()) {988 for (auto* run = firstRun; run; run = run->next()) { 960 989 ASSERT(run->box()); 961 990 if (!run->box()) 962 991 continue; // Skip runs with no line boxes. 963 992 964 InlineBox& box = *run->box();965 966 993 // Align positioned boxes with the top of the line box. This is 967 994 // a reasonable approximation of an appropriate y position. 968 if (run->renderer().isOutOfFlowPositioned()) 969 box.setLogicalTop(logicalHeight()); 995 auto& renderer = run->renderer(); 996 if (renderer.isOutOfFlowPositioned()) 997 run->box()->setLogicalTop(logicalHeight()); 970 998 971 999 // Position is used to properly position both replaced elements and 972 1000 // to update the static normal flow x/y of positioned elements. 973 if (is<RenderText>(run->renderer())) 974 downcast<RenderText>(run->renderer()).positionLineBox(downcast<InlineTextBox>(box)); 975 else if (is<RenderBox>(run->renderer())) 976 downcast<RenderBox>(run->renderer()).positionLineBox(downcast<InlineElementBox>(box)); 977 else if (is<RenderLineBreak>(run->renderer())) 978 downcast<RenderLineBreak>(run->renderer()).replaceInlineBoxWrapper(downcast<InlineElementBox>(box)); 979 } 980 // Positioned objects and zero-length text nodes destroy their boxes in 981 // position(), which unnecessarily dirties the line. 982 lineBox->markDirty(false); 1001 bool inlineBoxIsRedundant = false; 1002 if (is<RenderText>(renderer)) { 1003 auto& inlineTextBox = downcast<InlineTextBox>(*run->box()); 1004 downcast<RenderText>(renderer).positionLineBox(inlineTextBox); 1005 inlineBoxIsRedundant = !inlineTextBox.len(); 1006 } else if (is<RenderBox>(renderer)) { 1007 downcast<RenderBox>(renderer).positionLineBox(downcast<InlineElementBox>(*run->box())); 1008 inlineBoxIsRedundant = renderer.isOutOfFlowPositioned(); 1009 } else if (is<RenderLineBreak>(renderer)) 1010 downcast<RenderLineBreak>(renderer).replaceInlineBoxWrapper(downcast<InlineElementBox>(*run->box())); 1011 // Check if we need to keep this box on the line at all. 1012 if (inlineBoxIsRedundant) 1013 removeInlineBox(*run, *lineBox); 1014 } 983 1015 } 984 1016 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r200116 r200220 2158 2158 setChildNeedsLayout(MarkOnlyThis); // Just mark the positioned object as needing layout, so it will update its position properly. 2159 2159 } 2160 2161 // Nuke the box.2162 box.removeFromParent();2163 delete &box;2164 2160 return; 2165 2161 } -
trunk/Source/WebCore/rendering/RenderText.cpp
r199777 r200220 1269 1269 void RenderText::positionLineBox(InlineTextBox& textBox) 1270 1270 { 1271 // FIXME: should not be needed!!! 1272 if (!textBox.len()) { 1273 // We want the box to be destroyed. 1274 textBox.removeFromParent(); 1275 m_lineBoxes.remove(textBox); 1276 delete &textBox; 1271 if (!textBox.len()) 1277 1272 return; 1278 }1279 1280 1273 m_containsReversedText |= !textBox.isLeftToRightDirection(); 1281 1274 }
Note:
See TracChangeset
for help on using the changeset viewer.