Changeset 20980 in webkit
- Timestamp:
- Apr 20, 2007, 5:24:43 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/WebCore/ChangeLog ¶
r20975 r20980 1 2007-04-20 David Hyatt <hyatt@apple.com> 2 3 Bug 13424, firstLineStyle and verticalPositionHint together take 4 33% of the time on the new tag nesting PLT. Don't waste time even 5 looking for first-line styles if no stylesheet used them. 6 7 Reviewed by beth 8 9 * css/CSSGrammar.y: 10 * dom/Document.cpp: 11 (WebCore::Document::Document): 12 * dom/Document.h: 13 (WebCore::Document::usesFirstLineRules): 14 (WebCore::Document::setUsesFirstLineRules): 15 * rendering/RenderObject.cpp: 16 (WebCore::RenderObject::verticalPositionHint): 17 (WebCore::RenderObject::firstLineStyle): 18 1 19 2007-04-20 Peter Kasting <pkasting@google.com> 2 20 -
TabularUnified trunk/WebCore/css/CSSGrammar.y ¶
r20496 r20980 852 852 if (doc) 853 853 doc->setUsesSiblingRules(true); 854 } else if (type == CSSSelector::PseudoFirstLine) { 855 CSSParser* p = static_cast<CSSParser*>(parser); 856 if (Document* doc = p->document()) 857 doc->setUsesFirstLineRules(true); 854 858 } 855 859 } … … 859 863 $3.lower(); 860 864 $$->m_value = atomicString($3); 861 if ($$->pseudoType() == CSSSelector::PseudoUnknown) 865 CSSSelector::PseudoType type = $$->pseudoType(); 866 if (type == CSSSelector::PseudoUnknown) 862 867 $$ = 0; 868 else if (type == CSSSelector::PseudoFirstLine) { 869 CSSParser* p = static_cast<CSSParser*>(parser); 870 if (Document* doc = p->document()) 871 doc->setUsesFirstLineRules(true); 872 } 863 873 } 864 874 // used by :lang -
TabularUnified trunk/WebCore/dom/Document.cpp ¶
r20950 r20980 326 326 m_usesDescendantRules = false; 327 327 m_usesSiblingRules = false; 328 m_usesFirstLineRules = false; 328 329 329 330 m_styleSelector = new CSSStyleSelector(this, m_usersheet, m_styleSheets.get(), !inCompatMode()); -
TabularUnified trunk/WebCore/dom/Document.h ¶
r20802 r20980 281 281 bool usesSiblingRules() const { return m_usesSiblingRules; } 282 282 void setUsesSiblingRules(bool b) { m_usesSiblingRules = b; } 283 bool usesFirstLineRules() const { return m_usesFirstLineRules; } 284 void setUsesFirstLineRules(bool b) { m_usesFirstLineRules = b; } 283 285 284 286 // Machinery for saving and restoring state when you leave and then go back to a page. … … 704 706 bool m_usesDescendantRules; 705 707 bool m_usesSiblingRules; 706 708 bool m_usesFirstLineRules; 709 707 710 String m_title; 708 711 bool m_titleSetExplicitly; -
TabularUnified trunk/WebCore/rendering/RenderObject.cpp ¶
r20794 r20980 2614 2614 short RenderObject::verticalPositionHint(bool firstLine) const 2615 2615 { 2616 if (firstLine) // We're only really a first-line style if the document actually uses first-line rules. 2617 firstLine = document()->usesFirstLineRules(); 2616 2618 short vpos = m_verticalPosition; 2617 2619 if (m_verticalPosition == PositionUndefined || firstLine) { … … 2778 2780 RenderStyle* RenderObject::firstLineStyle() const 2779 2781 { 2782 if (!document()->usesFirstLineRules()) 2783 return m_style; 2784 2780 2785 RenderStyle* s = m_style; 2781 2786 const RenderObject* obj = isText() ? parent() : this;
Note:
See TracChangeset
for help on using the changeset viewer.