Changeset 143060 in webkit
- Timestamp:
- Feb 15, 2013 3:11:47 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143046 r143060 1 2013-02-15 Elliott Sprehn <esprehn@chromium.org> 2 3 RenderQuote should not mark renderers as needing layout during layout 4 https://bugs.webkit.org/show_bug.cgi?id=109876 5 6 Reviewed by Ojan Vafai. 7 8 * fast/block/float/float-not-removed-from-pre-block-expected.txt: 9 * fast/css-generated-content/quote-layout-focus-crash-expected.txt: Added. 10 * fast/css-generated-content/quote-layout-focus-crash.html: Added. 11 1 12 2013-02-15 Rik Cabanier <cabanier@adobe.com> 2 13 -
trunk/LayoutTests/fast/block/float/float-not-removed-from-pre-block-expected.txt
r142885 r143060 1 1 Bug 101970: Heap-use-after-free in WebCore::RenderLayerModelObject::hasSelfPaintingLayer 2 2 Test passes if it does not crash. 3 3 -
trunk/Source/WebCore/ChangeLog
r143054 r143060 1 2013-02-15 Elliott Sprehn <esprehn@chromium.org> 2 3 RenderQuote should not mark renderers as needing layout during layout 4 https://bugs.webkit.org/show_bug.cgi?id=109876 5 6 Reviewed by Ojan Vafai. 7 8 Marking RenderQuotes as needing pref width recalcs and layouts during a 9 layout is dangerous since an ancestor may mark itself as having completed 10 layout, but then some subtree still thinks it needs layout. 11 12 Instead, since the only time we create RenderQuote instances is inside 13 PseudoElement, we can call attachQuote inside PseudoElement::attach during 14 the regular tree mutating cycle. We can then use RenderQuote::styleDidChange 15 to update the kind of quotes on normal style changes. 16 17 This makes RenderQuote behave much more similarly to DOM nodes and means 18 we no longer need to set dirty bits during layout. 19 20 Test: fast/css-generated-content/quote-layout-focus-crash.html 21 22 * dom/PseudoElement.cpp: 23 (WebCore::PseudoElement::attach): Now call attachQuote(). 24 * rendering/RenderQuote.cpp: 25 (WebCore::RenderQuote::~RenderQuote): 26 (WebCore::RenderQuote::willBeRemovedFromTree): 27 (WebCore::RenderQuote::styleDidChange): 28 (WebCore::RenderQuote::updateText): 29 (WebCore::RenderQuote::attachQuote): 30 (WebCore::RenderQuote::detachQuote): 31 (WebCore::RenderQuote::updateDepth): 32 * rendering/RenderQuote.h: 33 (RenderQuote): 34 1 35 2013-02-15 Sheriff Bot <webkit.review.bot@gmail.com> 2 36 -
trunk/Source/WebCore/dom/PseudoElement.cpp
r141524 r143060 31 31 #include "NodeRenderingContext.h" 32 32 #include "RenderObject.h" 33 #include "RenderQuote.h" 33 34 34 35 namespace WebCore { … … 83 84 for (const ContentData* content = style->contentData(); content; content = content->next()) { 84 85 RenderObject* child = content->createRenderer(document(), style); 85 if (renderer->isChildAllowed(child, style)) 86 if (renderer->isChildAllowed(child, style)) { 86 87 renderer->addChild(child); 87 else 88 if (child->isQuote()) 89 toRenderQuote(child)->attachQuote(); 90 } else 88 91 child->destroy(); 89 92 } -
trunk/Source/WebCore/rendering/RenderQuote.cpp
r142056 r143060 55 55 { 56 56 RenderText::willBeRemovedFromTree(); 57 58 57 detachQuote(); 58 } 59 60 void RenderQuote::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 61 { 62 RenderText::styleDidChange(diff, oldStyle); 63 updateText(); 59 64 } 60 65 … … 246 251 void RenderQuote::updateText() 247 252 { 248 computePreferredLogicalWidths(0); 249 } 250 251 void RenderQuote::computePreferredLogicalWidths(float lead) 252 { 253 #ifndef NDEBUG 254 // FIXME: We shouldn't be modifying the tree in computePreferredLogicalWidths. 255 // Instead, we should properly hook the appropriate changes in the DOM and modify 256 // the render tree then. When that's done, we also won't need to override 257 // computePreferredLogicalWidths at all. 258 // https://bugs.webkit.org/show_bug.cgi?id=104829 259 SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false); 260 #endif 261 262 if (!m_attached) 263 attachQuote(); 264 setTextInternal(originalText()); 265 266 RenderText::computePreferredLogicalWidths(lead); 253 setText(originalText()); 267 254 } 268 255 … … 286 273 ASSERT(!m_attached); 287 274 ASSERT(!m_next && !m_previous); 288 289 // FIXME: Don't set pref widths dirty during layout. See updateDepth() for 290 // more detail. 291 if (!isRooted()) { 292 setNeedsLayoutAndPrefWidthsRecalc(); 293 return; 294 } 275 ASSERT(isRooted()); 295 276 296 277 if (!view()->renderQuoteHead()) { … … 371 352 } 372 353 } 373 // FIXME: Don't call setNeedsLayout or dirty our preferred widths during layout.374 // This is likely to fail anyway as one of our ancestor will call setNeedsLayout(false),375 // preventing the future layout to occur on |this|. The solution is to move that to a376 // pre-layout phase.377 354 if (oldDepth != m_depth) 378 setNeedsLayoutAndPrefWidthsRecalc();355 updateText(); 379 356 } 380 357 -
trunk/Source/WebCore/rendering/RenderQuote.h
r142885 r143060 37 37 virtual ~RenderQuote(); 38 38 void attachQuote(); 39 40 virtual void updateText() OVERRIDE; 41 42 private: 39 43 void detachQuote(); 40 44 41 private:42 45 virtual void willBeDestroyed() OVERRIDE; 43 46 virtual const char* renderName() const OVERRIDE { return "RenderQuote"; }; 44 47 virtual bool isQuote() const OVERRIDE { return true; }; 45 48 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; 46 47 virtual void updateText() OVERRIDE; 48 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; 49 virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE; 49 50 50 51 // We don't override insertedIntoTree to call attachQuote() as it would be attached
Note: See TracChangeset
for help on using the changeset viewer.