angler-fishThe Vulnerability History Project

Reduce non-CSSOM API of CSSStyleDeclaration

      https://bugs.webkit.org/show_bug.cgi?id=77299

Reviewed by Andreas Kling.

../WebCore: 

CSSStyleDeclaration should expose the CSSOM API only. Subclasses should expose the internal API only. 
This will move us closer to being able to split the CSSOM API from the internal implementation.
        
- Make CSSStyleDeclaration CSSOM functions virtual, internal functions non-virtual.
- Move implementations to subclasses (CSSComputedStyleDeclaration, CSSMutableStyleDeclaration).
- Make CSSOM functions in the subclasses private (making it harder to invoke them internally).
- Switch a bunch of places to use internal API instead of CSSOM.

* bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
(WebCore::V8CSSStyleDeclaration::namedPropertyGetter):
(WebCore::V8CSSStyleDeclaration::namedPropertySetter):
        
    Switch to *Internal versions of the CSSOM functions.
        
* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::cssPropertyMatches):
(WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet):
        
    Move copyPropertiesInSet to subclasses, devirtualize.
            
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyPriority):
(WebCore::CSSComputedStyleDeclaration::getPropertyShorthand):
(WebCore::CSSComputedStyleDeclaration::isPropertyImplicit):
(WebCore::CSSComputedStyleDeclaration::setProperty):
(WebCore::CSSComputedStyleDeclaration::removeProperty):
* css/CSSComputedStyleDeclaration.h:
(CSSComputedStyleDeclaration):
* css/CSSFontFaceRule.cpp:
(WebCore::CSSFontFaceRule::cssText):
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::length):
(WebCore::CSSMutableStyleDeclaration::asText):
(WebCore::CSSMutableStyleDeclaration::cssText):
(WebCore):
(WebCore::CSSMutableStyleDeclaration::getProper
    
commit 43ebfe1051df6ec676c14c68011d24f8fd356619
-150
+3 -3
+19 -74
+14 -19
+1 -1
+15 -118
+17 -34
+98
+26 -16
+1 -1
+4 -4
+1 -1
+2 -2
+6 -6
+31 -29
+1 -1
+7 -3
+4 -4
+1 -1
+2 -2
+9 -5
+1 -1
+1 -1
+1 -1
+2 -1
+6 -3
+8 -6
+1 -1
+1 -1
+4 -3
-13
+2 -3
expand_less