Changeset 143380 in webkit
- Timestamp:
- Feb 19, 2013 1:51:19 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143377 r143380 1 2013-02-19 Elliott Sprehn <esprehn@chromium.org> 2 3 Remove RenderText::updateText 4 https://bugs.webkit.org/show_bug.cgi?id=109991 5 6 Reviewed by Eric Seidel. 7 8 There's no reason for the generic RenderText::updateText virtual hook 9 anymore now that r143060 made RenderQuote stop setting dirty bits during 10 layout since the hook is only used by RenderCounter. 11 12 Instead add updateCounterIfNeeded and make it clear this is a hack for 13 counters. 14 15 * rendering/RenderBlockLineLayout.cpp: 16 (WebCore::updateCounterIfNeeded): Added, not handles the counter specific hack. 17 (WebCore::dirtyLineBoxesForRenderer): 18 (WebCore::RenderBlock::LineBreaker::nextSegmentBreak): 19 * rendering/RenderCounter.cpp: 20 (WebCore::RenderCounter::updateCounter): 21 * rendering/RenderCounter.h: 22 (RenderCounter): 23 * rendering/RenderQuote.cpp: 24 (WebCore::RenderQuote::styleDidChange): 25 (WebCore::RenderQuote::updateDepth): 26 * rendering/RenderQuote.h: 27 (RenderQuote): 28 * rendering/RenderText.h: 29 (RenderText): 30 1 31 2013-02-19 Tony Chang <tony@chromium.org> 2 32 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r142659 r143380 30 30 #include "RenderArena.h" 31 31 #include "RenderCombineText.h" 32 #include "RenderCounter.h" 32 33 #include "RenderFlowThread.h" 33 34 #include "RenderInline.h" … … 427 428 } 428 429 430 // FIXME: Don't let counters mark themselves as needing pref width recalcs during layout 431 // so we don't need this hack. 432 static inline void updateCounterIfNeeded(RenderText* o) 433 { 434 if (!o->preferredLogicalWidthsDirty() || !o->isCounter()) 435 return; 436 toRenderCounter(o)->updateCounter(); 437 } 438 429 439 static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout) 430 440 { 431 441 if (o->isText()) { 432 442 RenderText* renderText = toRenderText(o); 433 renderText->updateTextIfNeeded(); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.443 updateCounterIfNeeded(renderText); 434 444 renderText->dirtyLineBoxes(fullLayout); 435 445 } else … … 2783 2793 2784 2794 if (renderTextInfo.m_text != t) { 2785 t->updateTextIfNeeded();2795 updateCounterIfNeeded(t); 2786 2796 renderTextInfo.m_text = t; 2787 2797 renderTextInfo.m_font = &f; -
trunk/Source/WebCore/rendering/RenderCounter.cpp
r142056 r143380 513 513 } 514 514 515 void RenderCounter::update Text()515 void RenderCounter::updateCounter() 516 516 { 517 517 computePreferredLogicalWidths(0); -
trunk/Source/WebCore/rendering/RenderCounter.h
r140640 r143380 41 41 static void rendererStyleChanged(RenderObject*, const RenderStyle* oldStyle, const RenderStyle* newStyle); 42 42 43 void updateCounter(); 44 43 45 protected: 44 46 virtual void willBeDestroyed(); … … 49 51 virtual PassRefPtr<StringImpl> originalText() const; 50 52 51 virtual void updateText() OVERRIDE;52 53 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; 53 54 -
trunk/Source/WebCore/rendering/RenderQuote.cpp
r143060 r143380 61 61 { 62 62 RenderText::styleDidChange(diff, oldStyle); 63 updateText();63 setText(originalText()); 64 64 } 65 65 … … 249 249 } 250 250 251 void RenderQuote::updateText()252 {253 setText(originalText());254 }255 256 251 const QuotesData* RenderQuote::quotesData() const 257 252 { … … 353 348 } 354 349 if (oldDepth != m_depth) 355 updateText();350 setText(originalText()); 356 351 } 357 352 -
trunk/Source/WebCore/rendering/RenderQuote.h
r143060 r143380 38 38 void attachQuote(); 39 39 40 virtual void updateText() OVERRIDE;41 42 40 private: 43 41 void detachQuote(); … … 48 46 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; 49 47 virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE; 50 51 // We don't override insertedIntoTree to call attachQuote() as it would be attached52 // too early and get the wrong depth since generated content is inserted into anonymous53 // renderers before going into the main render tree. Once we can ensure that insertIntoTree,54 // is called on an attached tree, we should override it here.55 56 48 virtual void willBeRemovedFromTree() OVERRIDE; 57 49 -
trunk/Source/WebCore/rendering/RenderText.h
r142398 r143380 45 45 46 46 virtual PassRefPtr<StringImpl> originalText() const; 47 48 void updateTextIfNeeded()49 {50 if (preferredLogicalWidthsDirty())51 updateText();52 }53 47 54 48 void extractTextBox(InlineTextBox*); … … 153 147 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 154 148 155 virtual void updateText() { }156 149 virtual void setTextInternal(PassRefPtr<StringImpl>); 157 150 virtual UChar previousCharacter() const;
Note: See TracChangeset
for help on using the changeset viewer.