[webkit-changes] cvs commit: WebCore/kwq DOM-CSS.mm DOMCSS.h

Eric eseidel at opensource.apple.com
Sun Nov 20 13:34:16 PST 2005


eseidel     05/11/20 13:34:16

  Modified:    .        ChangeLog
               khtml/css cssparser.cpp cssstyleselector.cpp
                        cssstyleselector.h parser.y
               khtml/ecma kjs_views.cpp kjs_views.h
               khtml/xml dom2_viewsimpl.cpp dom2_viewsimpl.h
               kwq      DOM-CSS.mm DOMCSS.h
  Log:
  Bug #: 5777
  Submitted by: eseidel
  Reviewed by: none
         	Rolling out the getMatchedCSSRules change, as it caused
          many layout tests to crash on TOT:
          http://bugzilla.opendarwin.org/show_bug.cgi?id=5777
  
          * khtml/css/cssparser.cpp:
          * khtml/css/cssstyleselector.cpp:
          (khtml::CSSStyleSelector::matchRules):
          (khtml::CSSStyleSelector::matchRulesForList):
          (khtml::CSSStyleSelector::initForStyleResolve):
          * khtml/css/cssstyleselector.h:
          * khtml/css/parser.y:
          * khtml/ecma/kjs_views.cpp:
          (KJS::DOMAbstractViewProtoFunc::callAsFunction):
          * khtml/ecma/kjs_views.h:
          (KJS::DOMAbstractView::):
          * khtml/xml/dom2_viewsimpl.cpp:
          (DOM::AbstractViewImpl::getComputedStyle):
          * khtml/xml/dom2_viewsimpl.h:
          * kwq/DOM-CSS.mm:
          * kwq/DOMCSS.h:
  
  Revision  Changes    Path
  1.385     +25 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.384
  retrieving revision 1.385
  diff -u -r1.384 -r1.385
  --- ChangeLog	19 Nov 2005 02:36:21 -0000	1.384
  +++ ChangeLog	20 Nov 2005 21:34:09 -0000	1.385
  @@ -1,3 +1,28 @@
  +2005-11-20  Eric Seidel  <eseidel at apple.com>
  +
  +        No review, rollout only.
  +
  +       	Rolling out the getMatchedCSSRules change, as it caused
  +        many layout tests to crash on TOT:
  +        http://bugzilla.opendarwin.org/show_bug.cgi?id=5777
  +
  +        * khtml/css/cssparser.cpp:
  +        * khtml/css/cssstyleselector.cpp:
  +        (khtml::CSSStyleSelector::matchRules):
  +        (khtml::CSSStyleSelector::matchRulesForList):
  +        (khtml::CSSStyleSelector::initForStyleResolve):
  +        * khtml/css/cssstyleselector.h:
  +        * khtml/css/parser.y:
  +        * khtml/ecma/kjs_views.cpp:
  +        (KJS::DOMAbstractViewProtoFunc::callAsFunction):
  +        * khtml/ecma/kjs_views.h:
  +        (KJS::DOMAbstractView::):
  +        * khtml/xml/dom2_viewsimpl.cpp:
  +        (DOM::AbstractViewImpl::getComputedStyle):
  +        * khtml/xml/dom2_viewsimpl.h:
  +        * kwq/DOM-CSS.mm:
  +        * kwq/DOMCSS.h:
  +
   2005-11-18  David Harrison  <harrison at apple.com>
   
           Reviewed by Tim Hatcher.
  
  
  
  1.111     +1 -2      WebCore/khtml/css/cssparser.cpp
  
  Index: cssparser.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssparser.cpp,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- cssparser.cpp	17 Nov 2005 21:28:10 -0000	1.110
  +++ cssparser.cpp	20 Nov 2005 21:34:12 -0000	1.111
  @@ -2,8 +2,7 @@
    * This file is part of the DOM implementation for KDE.
    *
    * Copyright (C) 2003 Lars Knoll (knoll at kde.org)
  - * Copyright (C) 2005 Allan Sandfeld Jensen (kde at carewolf.com)
  - * Copyright (C) 2004, 2005 Apple Computer, Inc.
  + * Copyright (C) 2004 Apple Computer, Inc.
    *
    * This library is free software; you can redistribute it and/or
    * modify it under the terms of the GNU Library General Public
  
  
  
  1.222     +5 -54     WebCore/khtml/css/cssstyleselector.cpp
  
  Index: cssstyleselector.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.cpp,v
  retrieving revision 1.221
  retrieving revision 1.222
  diff -u -r1.221 -r1.222
  --- cssstyleselector.cpp	17 Nov 2005 21:28:10 -0000	1.221
  +++ cssstyleselector.cpp	20 Nov 2005 21:34:13 -0000	1.222
  @@ -2,8 +2,7 @@
    * This file is part of the CSS implementation for KDE.
    *
    * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  - *           (C) 2004-2005 Allan Sandfeld Jensen (kde at carewolf.com)
  - * Copyright (C) 2005 Apple Computer, Inc.
  + * Copyright (C) 2004 Apple Computer, Inc.
    *
    * This library is free software; you can redistribute it and/or
    * modify it under the terms of the GNU Library General Public
  @@ -378,16 +377,8 @@
       sortMatchedRules(0, m_matchedRuleCount);
       
       // Now transfer the set of matched rules over to our list of decls.
  -    if (style) {
  -        for (unsigned i = 0; i < m_matchedRuleCount; i++)
  -            addMatchedDeclaration(m_matchedRules[i]->rule()->declaration());
  -    } else {
  -        for (unsigned i = 0; i < m_matchedRuleCount; i++) {
  -            if (!m_ruleList)
  -                m_ruleList = new CSSRuleListImpl();
  -            m_ruleList->append(m_matchedRules[i]->rule());
  -        }
  -    }
  +    for (unsigned i = 0; i < m_matchedRuleCount; i++)
  +        addMatchedDeclaration(m_matchedRules[i]->rule()->declaration());
   }
   
   void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules,
  @@ -405,7 +396,7 @@
               
               // If we're matching normal rules, set a pseudo bit if 
               // we really just matched a pseudo-element.
  -            if (style && dynamicPseudo != RenderStyle::NOPSEUDO && pseudoStyle == RenderStyle::NOPSEUDO)
  +            if (dynamicPseudo != RenderStyle::NOPSEUDO && pseudoStyle == RenderStyle::NOPSEUDO)
                   style->setHasPseudoStyle(dynamicPseudo);
               else {
                   // Update our first/last rule indices in the matched rules array.
  @@ -529,8 +520,7 @@
       m_matchedRuleCount = 0;
       m_matchedDeclCount = 0;
       m_tmpRuleCount = 0;
  -    m_ruleList = 0;
  -
  +    
       fontDirty = false;
   }
   
  @@ -1045,45 +1035,6 @@
           view->useSlowRepaints();
   }
   
  -SharedPtr<CSSRuleListImpl> CSSStyleSelector::styleRulesForElement(ElementImpl* e, bool authorOnly)
  -{
  -    if (!e->getDocument()->haveStylesheetsLoaded())
  -        return 0;
  -
  -    initElementAndPseudoState(e);
  -    initForStyleResolve(e, 0);
  -    
  -    if (!authorOnly) {
  -        // First we match rules from the user agent sheet.
  -        int firstUARule = -1, lastUARule = -1;
  -        matchRules(defaultStyle, firstUARule, lastUARule);
  -        
  -        // In quirks mode, we match rules from the quirks user agent sheet.
  -        if (!strictParsing)
  -            matchRules(defaultQuirksStyle, firstUARule, lastUARule);
  -        
  -        // If our medium is print, then we match rules from the print sheet.
  -        if (m_medium == "print")
  -            matchRules(defaultPrintStyle, firstUARule, lastUARule);
  -
  -        // Now we check user sheet rules.
  -        int firstUserRule = -1, lastUserRule = -1;
  -        matchRules(m_userStyle, firstUserRule, lastUserRule);
  -    }
  -
  -    // Check the rules in author sheets.
  -    int firstAuthorRule = -1, lastAuthorRule = -1;
  -    matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
  -    
  -    return m_ruleList;
  -}
  -
  -SharedPtr<CSSRuleListImpl> CSSStyleSelector::pseudoStyleRulesForElement(ElementImpl* e, DOMStringImpl* pseudoStyle, bool authorOnly)
  -{
  -    // FIXME: Implement this.
  -    return 0;
  -}
  -
   static bool subject;
   
   bool CSSStyleSelector::checkSelector(CSSSelector* sel, ElementImpl *e)
  
  
  
  1.44      +1 -6      WebCore/khtml/css/cssstyleselector.h
  
  Index: cssstyleselector.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.h,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- cssstyleselector.h	17 Nov 2005 21:28:10 -0000	1.43
  +++ cssstyleselector.h	20 Nov 2005 21:34:13 -0000	1.44
  @@ -114,10 +114,6 @@
           DOM::NodeImpl* locateCousinList(DOM::ElementImpl* parent);
           bool canShareStyleWithElement(DOM::NodeImpl* n);
           
  -        // These methods will give back the set of rules that matched for a given element (or a pseudo-element).
  -        SharedPtr<DOM::CSSRuleListImpl> styleRulesForElement(DOM::ElementImpl* e, bool authorOnly);
  -        SharedPtr<DOM::CSSRuleListImpl> pseudoStyleRulesForElement(DOM::ElementImpl* e, DOM::DOMStringImpl* pseudoStyle, bool authorOnly);
  -
   	bool strictParsing;
   	
           struct Encodedurl {
  @@ -213,8 +209,7 @@
           unsigned m_matchedRuleCount;
           QMemArray<CSSRuleData*> m_tmpRules;
           unsigned m_tmpRuleCount;
  -        DOM::CSSRuleListImpl* m_ruleList;
  -
  +        
           QString m_medium;
   
   	RenderStyle::PseudoId dynamicPseudo;
  
  
  
  1.47      +1 -1      WebCore/khtml/css/parser.y
  
  Index: parser.y
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/parser.y,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- parser.y	17 Nov 2005 21:28:10 -0000	1.46
  +++ parser.y	20 Nov 2005 21:34:13 -0000	1.47
  @@ -38,7 +38,7 @@
   // #define CSS_DEBUG
   
   using namespace DOM;
  -using namespace HTMLNames;
  + using namespace HTMLNames;
   
   //
   // The following file defines the function
  
  
  
  1.17      +1 -12     WebCore/khtml/ecma/kjs_views.cpp
  
  Index: kjs_views.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- kjs_views.cpp	17 Nov 2005 21:28:12 -0000	1.16
  +++ kjs_views.cpp	20 Nov 2005 21:34:14 -0000	1.17
  @@ -32,7 +32,7 @@
   using DOM::DocumentImpl;
   using DOM::ElementImpl;
   using DOM::NodeImpl;
  -using DOM::CSSRuleListImpl;
  +
   
   #include "kjs_views.lut.h"
   
  @@ -47,7 +47,6 @@
   @end
   @begin DOMAbstractViewProtoTable 1
     getComputedStyle	DOMAbstractView::GetComputedStyle	DontDelete|Function 2
  -  getMatchedCSSRules   DOMAbstractView::GetMatchedCSSRules    DontDelete|Function 2
   @end
   */
   
  @@ -93,16 +92,6 @@
             return getDOMCSSStyleDeclaration(exec, abstractView.getComputedStyle(arg0, args[1]->toString(exec).domString().impl()));
           }
         }
  -    case DOMAbstractView::GetMatchedCSSRules: {
  -        ElementImpl *arg0 = toElement(args[0]);
  -        if (!arg0)
  -          return Undefined(); // throw exception?
  -        else {
  -          // No need to update layout, since we just want the back-end rules.
  -          return getDOMCSSRuleList(exec, abstractView.getMatchedCSSRules(arg0, args[1]->toString(exec).domString().impl()).get());
  -        }
  -      }
  -
     }
     return Undefined();
   }
  
  
  
  1.12      +1 -1      WebCore/khtml/ecma/kjs_views.h
  
  Index: kjs_views.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- kjs_views.h	17 Nov 2005 21:28:12 -0000	1.11
  +++ kjs_views.h	20 Nov 2005 21:34:14 -0000	1.12
  @@ -39,7 +39,7 @@
       virtual const ClassInfo* classInfo() const { return &info; }
       static const ClassInfo info;
       DOM::AbstractViewImpl *impl() const { return m_impl.get(); }
  -    enum { Document, GetComputedStyle, GetMatchedCSSRules };
  +    enum { Document, GetComputedStyle };
     private:
       SharedPtr<DOM::AbstractViewImpl> m_impl;
     };
  
  
  
  1.8       +1 -10     WebCore/khtml/xml/dom2_viewsimpl.cpp
  
  Index: dom2_viewsimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_viewsimpl.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- dom2_viewsimpl.cpp	17 Nov 2005 21:28:13 -0000	1.7
  +++ dom2_viewsimpl.cpp	20 Nov 2005 21:34:15 -0000	1.8
  @@ -26,8 +26,6 @@
   
   #include "css/css_computedstyle.h"
   #include "dom_elementimpl.h"
  -#include "dom_docimpl.h"
  -#include "cssstyleselector.h"
   
   namespace DOM {
   
  @@ -43,18 +41,11 @@
   CSSStyleDeclarationImpl *AbstractViewImpl::getComputedStyle(ElementImpl *elt, DOMStringImpl *pseudoElt)
   {
       // FIXME: This should work even if we do not have a renderer.
  -    // FIXME: This needs to work with pseudo elements.
  +    
       if (!elt || !elt->renderer())
           return 0;
   
       return new CSSComputedStyleDeclarationImpl(elt);
   }
   
  -SharedPtr<CSSRuleListImpl> AbstractViewImpl::getMatchedCSSRules(ElementImpl* elt, DOMStringImpl* pseudoElt, bool authorOnly)
  -{
  -    if (pseudoElt && pseudoElt->l)
  -        return m_document->styleSelector()->pseudoStyleRulesForElement(elt, pseudoElt, authorOnly);
  -    return m_document->styleSelector()->styleRulesForElement(elt, authorOnly);
  -}
  -
   }
  
  
  
  1.10      +0 -3      WebCore/khtml/xml/dom2_viewsimpl.h
  
  Index: dom2_viewsimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_viewsimpl.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- dom2_viewsimpl.h	17 Nov 2005 21:28:13 -0000	1.9
  +++ dom2_viewsimpl.h	20 Nov 2005 21:34:15 -0000	1.10
  @@ -30,7 +30,6 @@
   
   class DocumentImpl;
   class CSSStyleDeclarationImpl;
  -class CSSRuleListImpl;
   class ElementImpl;
   class DOMStringImpl;
   
  @@ -43,8 +42,6 @@
   
       DocumentImpl *document() const { return m_document; }
       CSSStyleDeclarationImpl *getComputedStyle(ElementImpl *elt, DOMStringImpl *pseudoElt);
  -    SharedPtr<CSSRuleListImpl> getMatchedCSSRules(ElementImpl* elt, DOMStringImpl* pseudoElt, bool authorOnly = true);
  -
   protected:
       DocumentImpl *m_document;
   };
  
  
  
  1.31      +0 -7      WebCore/kwq/DOM-CSS.mm
  
  Index: DOM-CSS.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOM-CSS.mm,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- DOM-CSS.mm	17 Nov 2005 21:28:13 -0000	1.30
  +++ DOM-CSS.mm	20 Nov 2005 21:34:15 -0000	1.31
  @@ -2538,11 +2538,4 @@
           AbstractViewImpl([self _documentImpl]).getComputedStyle([elt _elementImpl], DOMString(pseudoElt).impl())];
   }
   
  -- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt
  -{
  -    // The parameter of "false" is handy for the DOM inspector and lets us see user agent and user rules.
  -    return [DOMCSSRuleList _ruleListWithImpl:
  -        AbstractViewImpl([self _documentImpl]).getMatchedCSSRules([elt _elementImpl], DOMString(pseudoElt).impl(), false).get()];
  -}
  -
   @end
  
  
  
  1.7       +0 -1      WebCore/kwq/DOMCSS.h
  
  Index: DOMCSS.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMCSS.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMCSS.h	17 Nov 2005 21:28:13 -0000	1.6
  +++ DOMCSS.h	20 Nov 2005 21:34:15 -0000	1.7
  @@ -456,7 +456,6 @@
   
   @interface DOMDocument (DOMViewCSS)
   - (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt;
  -- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt;
   @end
   
   @interface DOMDocument (DOMDocumentCSS)
  
  
  



More information about the webkit-changes mailing list