[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

simon.fraser at apple.com simon.fraser at apple.com
Fri Jan 21 14:41:43 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit b53b5a0383b4e6c403205548e3732c2b637d5b58
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 24 20:46:53 2010 +0000

    2010-12-24  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            CSSStyleSelector cleanup
            https://bugs.webkit.org/show_bug.cgi?id=51597
    
            Make some methods const. Add assertion to checkOneSelector, with the
            intention of later removing the if (!e) check (this is hot code).
    
            * css/CSSStyleSelector.cpp:
            (WebCore::CSSStyleSelector::locateCousinList):
            (WebCore::CSSStyleSelector::canShareStyleWithElement):
            (WebCore::CSSStyleSelector::locateSharedStyle):
            (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
            (WebCore::CSSStyleSelector::mmLength):
            (WebCore::CSSStyleSelector::inchLength):
            (WebCore::CSSStyleSelector::getColorFromPrimitiveValue):
            (WebCore::CSSStyleSelector::hasSelectorForAttribute):
            * css/CSSStyleSelector.h:
            (WebCore::CSSStyleSelector::fontSelector):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74649 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d75280a..bf7181f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-12-24  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        CSSStyleSelector cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=51597
+
+        Make some methods const. Add assertion to checkOneSelector, with the
+        intention of later removing the if (!e) check (this is hot code).
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::locateCousinList):
+        (WebCore::CSSStyleSelector::canShareStyleWithElement):
+        (WebCore::CSSStyleSelector::locateSharedStyle):
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+        (WebCore::CSSStyleSelector::mmLength):
+        (WebCore::CSSStyleSelector::inchLength):
+        (WebCore::CSSStyleSelector::getColorFromPrimitiveValue):
+        (WebCore::CSSStyleSelector::hasSelectorForAttribute):
+        * css/CSSStyleSelector.h:
+        (WebCore::CSSStyleSelector::fontSelector):
+
 2010-12-24  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 1ab7f40..d59f231 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -937,7 +937,7 @@ bool CSSStyleSelector::SelectorChecker::checkSelector(CSSSelector* sel, Element*
 
 static const unsigned cStyleSearchThreshold = 10;
 
-Node* CSSStyleSelector::locateCousinList(Element* parent, unsigned depth)
+Node* CSSStyleSelector::locateCousinList(Element* parent, unsigned depth) const
 {
     if (parent && parent->isStyledElement()) {
         StyledElement* p = static_cast<StyledElement*>(parent);
@@ -966,7 +966,7 @@ Node* CSSStyleSelector::locateCousinList(Element* parent, unsigned depth)
     return 0;
 }
 
-bool CSSStyleSelector::canShareStyleWithElement(Node* n)
+bool CSSStyleSelector::canShareStyleWithElement(Node* n) const
 {
     if (n->isStyledElement()) {
         StyledElement* s = static_cast<StyledElement*>(n);
@@ -1051,7 +1051,7 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n)
     return false;
 }
 
-ALWAYS_INLINE RenderStyle* CSSStyleSelector::locateSharedStyle()
+ALWAYS_INLINE RenderStyle* CSSStyleSelector::locateSharedStyle() const
 {
     if (m_styledElement && !m_styledElement->inlineStyleDecl() && !m_styledElement->hasID() && !m_styledElement->document()->usesSiblingRules()) {
         // Check previous siblings.
@@ -2119,6 +2119,7 @@ static bool htmlAttributeHasCaseInsensitiveValue(const QualifiedName& attr)
 
 bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Element* e, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isSubSelector, RenderStyle* elementStyle, RenderStyle* elementParentStyle) const
 {
+    ASSERT(e);
     if (!e)
         return false;
 
@@ -5820,12 +5821,12 @@ bool CSSStyleSelector::pageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrim
     return true;
 }
 
-Length CSSStyleSelector::mmLength(double mm)
+Length CSSStyleSelector::mmLength(double mm) const
 {
     return Length(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
 }
 
-Length CSSStyleSelector::inchLength(double inch)
+Length CSSStyleSelector::inchLength(double inch) const
 {
     return Length(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
 }
@@ -6566,7 +6567,7 @@ static Color colorForCSSValue(int cssValueId)
     return RenderTheme::defaultTheme()->systemColor(cssValueId);
 }
 
-Color CSSStyleSelector::getColorFromPrimitiveValue(CSSPrimitiveValue* primitiveValue)
+Color CSSStyleSelector::getColorFromPrimitiveValue(CSSPrimitiveValue* primitiveValue) const
 {
     Color col;
     int ident = primitiveValue->getIdent();
@@ -6588,7 +6589,7 @@ Color CSSStyleSelector::getColorFromPrimitiveValue(CSSPrimitiveValue* primitiveV
     return col;
 }
 
-bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname)
+bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname) const
 {
     return m_selectorAttrs.contains(attrname.impl());
 }
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 87f6a95..b57ba13 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -108,9 +108,9 @@ public:
     private:
         void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO);
         void initElement(Element*);
-        ALWAYS_INLINE RenderStyle* locateSharedStyle();
-        Node* locateCousinList(Element* parent, unsigned depth = 1);
-        bool canShareStyleWithElement(Node*);
+        ALWAYS_INLINE RenderStyle* locateSharedStyle() const;
+        Node* locateCousinList(Element* parent, unsigned depth = 1) const;
+        bool canShareStyleWithElement(Node*) const;
 
         RenderStyle* style() const { return m_style.get(); }
 
@@ -147,11 +147,11 @@ public:
         static float getComputedSizeFromSpecifiedSize(Document*, RenderStyle*, bool isAbsoluteSize, float specifiedSize, bool useSVGZoomRules);
 
     public:
-        Color getColorFromPrimitiveValue(CSSPrimitiveValue*);
+        Color getColorFromPrimitiveValue(CSSPrimitiveValue*) const;
 
-        bool hasSelectorForAttribute(const AtomicString&);
+        bool hasSelectorForAttribute(const AtomicString&) const;
  
-        CSSFontSelector* fontSelector() { return m_fontSelector.get(); }
+        CSSFontSelector* fontSelector() const { return m_fontSelector.get(); }
 
         // Checks if a compound selector (which can consist of multiple simple selectors) matches the current element.
         bool checkSelector(CSSSelector*);
@@ -266,8 +266,8 @@ public:
         void applyProperty(int id, CSSValue*);
         void applyPageSizeProperty(CSSValue*);
         bool pageSizeFromName(CSSPrimitiveValue*, CSSPrimitiveValue*, Length& width, Length& height);
-        Length mmLength(double mm);
-        Length inchLength(double inch);
+        Length mmLength(double mm) const;
+        Length inchLength(double inch) const;
 #if ENABLE(SVG)
         void applySVGProperty(int id, CSSValue*);
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list