WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-119712-20201023135318.patch (text/plain), 13.13 KB, created by
Sam Weinig
on 2020-10-23 13:53:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2020-10-23 13:53:19 PDT
Size:
13.13 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 268939) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2020-10-23 Sam Weinig <weinig@apple.com> >+ >+ Remove support for 'pixel' and 'pos' CSSOM prefixes >+ https://bugs.webkit.org/show_bug.cgi?id=119712 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove support for pixel/pos prefixed properties of CSSStyleDeclaration which >+ are no longer supported by any other browser. >+ >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateAttributeGetterBodyDefinition): >+ (GenerateAttributeSetterBodyDefinition): >+ * css/CSSStyleDeclaration.cpp: >+ (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): >+ (WebCore::CSSStyleDeclaration::getPropertyValueInternalForPosOrPixelPrefixed): Deleted. >+ (WebCore::CSSStyleDeclaration::setPropertyValueInternalForPosOrPixelPrefixed): Deleted. >+ * css/CSSStyleDeclaration.h: >+ * css/makeprop.pl: >+ > 2020-10-23 Eric Carlson <eric.carlson@apple.com> > > [Media in GPU Process] in-band metadata cues sometimes crash >Index: Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >=================================================================== >--- Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (revision 268872) >+++ Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (working copy) >@@ -5283,8 +5283,7 @@ sub GenerateAttributeGetterBodyDefinitio > $implIncludes{"CSSPropertyNames.h"} = 1; > my $propertyID = $attribute->extendedAttributes->{CSSProperty}; > >- my $getterName = $attribute->type->isUnion ? "getPropertyValueInternalForPosOrPixelPrefixed" : "getPropertyValueInternal"; >- >+ my $getterName = "getPropertyValueInternal"; > my $toJSExpression = NativeToJSValueUsingReferences($attribute, $interface, "impl.${getterName}(CSSProperty${propertyID})", "*thisObject.globalObject()"); > push(@$outputArray, " auto& impl = thisObject.wrapped();\n"); > push(@$outputArray, " RELEASE_AND_RETURN(throwScope, (${toJSExpression}));\n"); >@@ -5437,8 +5436,8 @@ sub GenerateAttributeSetterBodyDefinitio > > my $propertyID = $attribute->extendedAttributes->{CSSProperty}; > >- my $setterName = $attribute->type->isUnion ? "setPropertyValueInternalForPosOrPixelPrefixed" : "setPropertyValueInternal"; >- >+ my $setterName = "setPropertyValueInternal"; >+ > my $exceptionThrower = GetAttributeExceptionThrower($interface, $attribute); > my $toNativeExpression = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&lexicalGlobalObject", "lexicalGlobalObject", "thisObject", "*thisObject.globalObject()", $exceptionThrower); > >Index: Source/WebCore/css/CSSStyleDeclaration.cpp >=================================================================== >--- Source/WebCore/css/CSSStyleDeclaration.cpp (revision 268872) >+++ Source/WebCore/css/CSSStyleDeclaration.cpp (working copy) >@@ -47,13 +47,10 @@ enum class PropertyNamePrefix { > None, > Epub, > CSS, >- Pixel, >- Pos, > WebKit > }; > >-template<size_t prefixCStringLength> >-static inline bool matchesCSSPropertyNamePrefix(const StringImpl& propertyName, const char (&prefix)[prefixCStringLength]) >+template<size_t prefixCStringLength> static inline bool matchesCSSPropertyNamePrefix(const StringImpl& propertyName, const char (&prefix)[prefixCStringLength]) > { > size_t prefixLength = prefixCStringLength - 1; > >@@ -98,12 +95,6 @@ static PropertyNamePrefix propertyNamePr > if (matchesCSSPropertyNamePrefix(propertyName, "epub")) > return PropertyNamePrefix::Epub; > break; >- case 'p': >- if (matchesCSSPropertyNamePrefix(propertyName, "pos")) >- return PropertyNamePrefix::Pos; >- if (matchesCSSPropertyNamePrefix(propertyName, "pixel")) >- return PropertyNamePrefix::Pixel; >- break; > case 'w': > if (matchesCSSPropertyNamePrefix(propertyName, "webkit")) > return PropertyNamePrefix::WebKit; >@@ -136,30 +127,23 @@ static inline void writeEpubPrefix(char* > *buffer++ = '-'; > } > >-struct CSSPropertyInfo { >- CSSPropertyID propertyID; >- bool hadPixelOrPosPrefix; >-}; >- >-static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName) >+static CSSPropertyID parseJavaScriptCSSPropertyName(const AtomString& propertyName) > { >- using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>; >- static NeverDestroyed<CSSPropertyInfoMap> propertyInfoCache; >+ using CSSPropertyIDMap = HashMap<String, CSSPropertyID>; >+ static NeverDestroyed<CSSPropertyIDMap> propertyIDCache; > >- CSSPropertyInfo propertyInfo = { CSSPropertyInvalid, false }; >+ CSSPropertyID propertyID = CSSPropertyInvalid; > > auto* propertyNameString = propertyName.impl(); > if (!propertyNameString) >- return propertyInfo; >+ return propertyID; > unsigned length = propertyNameString->length(); > if (!length) >- return propertyInfo; >+ return propertyID; > >- propertyInfo = propertyInfoCache.get().get(propertyNameString); >- if (propertyInfo.propertyID) >- return propertyInfo; >- >- bool hadPixelOrPosPrefix = false; >+ propertyID = propertyIDCache.get().get(propertyNameString); >+ if (propertyID) >+ return propertyID; > > constexpr size_t bufferSize = maxCSSPropertyNameLength + 1; > char buffer[bufferSize]; >@@ -167,25 +151,17 @@ static CSSPropertyInfo parseJavaScriptCS > const char* name = bufferPtr; > > unsigned i = 0; >- // Prefixes CSS, Pixel, Pos are ignored. >- // Prefixes Apple, KHTML and Webkit are transposed to "-webkit-". >- // The prefix "Epub" becomes "-epub-". >+ // Prefix CSS is ignored. >+ // Prefix Webkit becomes "-webkit-". >+ // Prefix Epub becomes "-epub-". > switch (propertyNamePrefix(*propertyNameString)) { > case PropertyNamePrefix::None: > if (isASCIIUpper((*propertyNameString)[0])) >- return propertyInfo; >+ return propertyID; > break; > case PropertyNamePrefix::CSS: > i += 3; > break; >- case PropertyNamePrefix::Pixel: >- i += 5; >- hadPixelOrPosPrefix = true; >- break; >- case PropertyNamePrefix::Pos: >- i += 3; >- hadPixelOrPosPrefix = true; >- break; > case PropertyNamePrefix::Epub: > writeEpubPrefix(bufferPtr); > i += 4; >@@ -203,17 +179,17 @@ static CSSPropertyInfo parseJavaScriptCS > size_t bufferSizeLeft = stringEnd - bufferPtr; > size_t propertySizeLeft = length - i; > if (propertySizeLeft > bufferSizeLeft) >- return propertyInfo; >+ return propertyID; > > for (; i < length; ++i) { > UChar c = (*propertyNameString)[i]; > if (!c || !isASCII(c)) >- return propertyInfo; // illegal character >+ return propertyID; // illegal character > if (isASCIIUpper(c)) { > size_t bufferSizeLeft = stringEnd - bufferPtr; > size_t propertySizeLeft = length - i + 1; > if (propertySizeLeft > bufferSizeLeft) >- return propertyInfo; >+ return propertyID; > *bufferPtr++ = '-'; > *bufferPtr++ = toASCIILowerUnchecked(c); > } else >@@ -229,22 +205,19 @@ static CSSPropertyInfo parseJavaScriptCS > #endif > > auto* hashTableEntry = findProperty(name, outputLength); >- if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) { >- auto id = static_cast<CSSPropertyID>(propertyID); >- propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; >- propertyInfo.propertyID = id; >- propertyInfoCache.get().add(propertyNameString, propertyInfo); >+ if (auto id = hashTableEntry ? hashTableEntry->id : 0) { >+ propertyID = static_cast<CSSPropertyID>(id); >+ propertyIDCache.get().add(propertyNameString, propertyID); > } >- return propertyInfo; >+ return propertyID; > } > >-static CSSPropertyInfo propertyInfoFromJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settings) >+static CSSPropertyID propertyIDFromJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settings) > { >- auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); >- auto id = propertyInfo.propertyID; >+ auto id = parseJavaScriptCSSPropertyName(propertyName); > if (!isEnabledCSSProperty(id) || !isCSSPropertyEnabledBySettings(id, settings)) >- return { CSSPropertyInvalid, false }; >- return propertyInfo; >+ return CSSPropertyInvalid; >+ return id; > } > > } >@@ -267,36 +240,9 @@ ExceptionOr<void> CSSStyleDeclaration::s > return { }; > } > >-Variant<double, String> CSSStyleDeclaration::getPropertyValueInternalForPosOrPixelPrefixed(CSSPropertyID propertyID) >-{ >- auto value = getPropertyCSSValueInternal(propertyID); >- if (!value) { >- // If the property is a shorthand property (such as "padding"), it can only be accessed using getPropertyValue. >- return getPropertyValueInternal(propertyID); >- } >- >- if (is<CSSPrimitiveValue>(*value)) { >- // Call this version of the getter so that, e.g., pixelTop returns top as a number >- // in pixel units and posTop should does the same _if_ this is a positioned element. >- // FIXME: If not a positioned element, MSIE documentation says posTop should return 0; this rule is not implemented. >- return downcast<CSSPrimitiveValue>(*value).floatValue(CSSUnitType::CSS_PX); >- } >- >- return value->cssText(); >-} >- >-ExceptionOr<void> CSSStyleDeclaration::setPropertyValueInternalForPosOrPixelPrefixed(CSSPropertyID propertyID, Variant<double, String> value) >-{ >- auto stringValue = WTF::switchOn(value, [&] (const auto& input) { >- return makeString(input, "px"); >- }); >- >- return setPropertyValueInternal(propertyID, WTFMove(stringValue)); >-} >- > CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName) > { >- return propertyInfoFromJavaScriptCSSPropertyName(propertyName, nullptr).propertyID; >+ return propertyIDFromJavaScriptCSSPropertyName(propertyName, nullptr); > } > > String CSSStyleDeclaration::cssFloat() >Index: Source/WebCore/css/CSSStyleDeclaration.h >=================================================================== >--- Source/WebCore/css/CSSStyleDeclaration.h (revision 268872) >+++ Source/WebCore/css/CSSStyleDeclaration.h (working copy) >@@ -73,8 +73,6 @@ public: > virtual CSSStyleSheet* parentStyleSheet() const { return nullptr; } > > ExceptionOr<void> setPropertyValueInternal(CSSPropertyID, String); >- Variant<double, String> getPropertyValueInternalForPosOrPixelPrefixed(CSSPropertyID); >- ExceptionOr<void> setPropertyValueInternalForPosOrPixelPrefixed(CSSPropertyID, Variant<double, String>); > > static CSSPropertyID getCSSPropertyIDFromJavaScriptPropertyName(const AtomString&); > >Index: Source/WebCore/css/makeprop.pl >=================================================================== >--- Source/WebCore/css/makeprop.pl (revision 268872) >+++ Source/WebCore/css/makeprop.pl (working copy) >@@ -1502,10 +1502,10 @@ foreach my $nameOrAlias (grep { $_ =~ /^ > > print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL << "EOF"; > >- // Non-standard. Add special cases for all properties not starting with -webkit- or -epub- >- // that puts an new prefix of css, Css, pos, Pos, pixel and Pixel on each. >- // Example top -> element.style.posTop >- // Example top -> element.style.PixelTop >+ // Non-standard. Adds an additional variant of all properties not starting with -webkit- or -epub- >+ // that is the property name prefixed by css and Css. >+ // Example top -> element.style.cssTop >+ // Example top -> element.style.CssTop > EOF > foreach my $nameOrAlias (grep { $_ !~ /^\-webkit\-|^\-epub\-/ } @namesAndAliases) { > my $camelCasedAttributeName = cssPropertyToIDLAttribute($nameOrAlias, 0, 1); >@@ -1519,10 +1519,6 @@ foreach my $nameOrAlias (grep { $_ !~ /^ > > print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute [LegacyNullToEmptyString] CSSOMString css${camelCasedAttributeName};\n" unless $camelCasedAttributeName eq "Float"; > print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute [LegacyNullToEmptyString] CSSOMString Css${camelCasedAttributeName};\n" unless $camelCasedAttributeName eq "Float"; >- print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute (double or [LegacyNullToEmptyString] CSSOMString) pos${camelCasedAttributeName};\n"; >- print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute (double or [LegacyNullToEmptyString] CSSOMString) Pos${camelCasedAttributeName};\n"; >- print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute (double or [LegacyNullToEmptyString] CSSOMString) pixel${camelCasedAttributeName};\n"; >- print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL " [CEReactions, ${extendedAttributes}] attribute (double or [LegacyNullToEmptyString] CSSOMString) Pixel${camelCasedAttributeName};\n"; > } > > print CSS_STYLE_DECLARATION_PROPERTY_NAMES_IDL << "EOF";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 119712
:
208584
|
412209
|
412210
|
412241
|
421728
|
421729
|
421732
|
421733
|
421748