haikuwebkit/Source/WebCore/css/DeprecatedCSSOMValue.cpp

83 lines
2.8 KiB
C++
Raw Permalink Normal View History

[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM https://bugs.webkit.org/show_bug.cgi?id=165968 Reviewed by Andreas Kling. Source/WebCore: This patch changes the CSS OM for values to use distinct wrapper classes instead of cloning the existing classes. By actually wrapping values instead of cloning, we are freed up to change our CSS value hierarchy however we'd like (such as changing to match the new CSS Values OM that is coming soon). All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM" to reflect our desire (ultimately) to remove this API from our tree. We're the only ones that support it, and it's not used on the Web, but it is part of the WebKitLegacy API and might be used internally. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/DOMWrapperWorld.h: * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): * bindings/js/JSCSSValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): (WebCore::JSDeprecatedCSSOMValueOwner::finalize): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted. (WebCore::JSCSSValueOwner::finalize): Deleted. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSComputedStyleDeclaration.h: * css/CSSGridLineNamesValue.cpp: (WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted. * css/CSSGridLineNamesValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::cloneForCSSOM): Deleted. * css/CSSImageSetValue.h: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper): (WebCore::CSSImageValue::cloneForCSSOM): Deleted. * css/CSSImageValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper): (WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted. * css/CSSPrimitiveValue.h: * css/CSSPrimitiveValue.idl: Removed. * css/CSSStyleDeclaration.h: * css/CSSStyleDeclaration.idl: * css/CSSValue.cpp: (WebCore::CSSValue::traverseSubresources): (WebCore::CSSValue::equals): (WebCore::CSSValue::cssText): (WebCore::CSSValue::destroy): (WebCore::CSSValue::createDeprecatedCSSOMWrapper): (): Deleted. (WebCore::CSSValue::cloneForCSSOM): Deleted. * css/CSSValue.h: (WebCore::CSSValue::CSSValue): (WebCore::CSSValue::setCssText): Deleted. (WebCore::CSSValue::isCSSOMSafe): Deleted. (WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted. * css/CSSValue.idl: Removed. * css/CSSValueList.cpp: (WebCore::CSSValueList::cloneForCSSOM): Deleted. * css/CSSValueList.h: (WebCore::CSSValueList::separator): * css/CSSValueList.idl: Removed. * css/Counter.h: * css/Counter.idl: Removed. * css/DeprecatedCSSOMCounter.h: Added. * css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl. * css/DeprecatedCSSOMPrimitiveValue.cpp: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue): * css/DeprecatedCSSOMPrimitiveValue.h: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::create): (WebCore::DeprecatedCSSOMPrimitiveValue::equals): (WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType): (WebCore::DeprecatedCSSOMPrimitiveValue::cssText): (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::stringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue): * css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl. * css/DeprecatedCSSOMRGBColor.h: Added. * css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl. * css/DeprecatedCSSOMRect.h: Added. * css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl. * css/DeprecatedCSSOMValue.cpp: Added. (WebCore::compareCSSOMValues): (WebCore::DeprecatedCSSOMValue::equals): (WebCore::DeprecatedCSSOMValue::destroy): (WebCore::DeprecatedCSSOMValue::cssValueType): (WebCore::DeprecatedCSSOMValue::cssText): * css/DeprecatedCSSOMValue.h: Added. (WebCore::DeprecatedCSSOMValue::deref): (WebCore::DeprecatedCSSOMValue::setCssText): (WebCore::DeprecatedCSSOMValue::operator==): (WebCore::DeprecatedCSSOMValue::isComplexValue): (WebCore::DeprecatedCSSOMValue::isPrimitiveValue): (WebCore::DeprecatedCSSOMValue::isValueList): (WebCore::DeprecatedCSSOMValue::classType): (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMComplexValue::create): (WebCore::DeprecatedCSSOMComplexValue::equals): (WebCore::DeprecatedCSSOMComplexValue::cssText): (WebCore::DeprecatedCSSOMComplexValue::cssValueType): (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue): * css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl. * css/DeprecatedCSSOMValueList.cpp: Added. (WebCore::DeprecatedCSSOMValueList::equals): (WebCore::DeprecatedCSSOMValueList::cssText): * css/DeprecatedCSSOMValueList.h: Added. (WebCore::DeprecatedCSSOMValueList::create): (WebCore::DeprecatedCSSOMValueList::cssValueType): (WebCore::DeprecatedCSSOMValueList::length): (WebCore::DeprecatedCSSOMValueList::item): (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): * css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl. * css/LengthRepeat.h: * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue): (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM): (WebCore::StyleRuleCSSStyleDeclaration::didMutate): (WebCore::InlineCSSStyleDeclaration::didMutate): (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted. * css/PropertySetCSSStyleDeclaration.h: * css/RGBColor.cpp: (WebCore::RGBColor::red): Deleted. (WebCore::RGBColor::green): Deleted. (WebCore::RGBColor::blue): Deleted. (WebCore::RGBColor::alpha): Deleted. * css/RGBColor.h: * css/RGBColor.idl: Removed. * css/Rect.h: (WebCore::RectBase::RectBase): * css/Rect.idl: Removed. * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): * svg/SVGElement.h: * svg/SVGElement.idl: Source/WebKit/mac: * DOM/DOMCSS.mm: (kitClass): * DOM/DOMCSSPrimitiveValue.mm: (-[DOMCSSPrimitiveValue getCounterValue]): (-[DOMCSSPrimitiveValue getRectValue]): (kit): * DOM/DOMCSSPrimitiveValueInternal.h: * DOM/DOMCSSStyleDeclaration.mm: * DOM/DOMCSSValue.mm: (kit): * DOM/DOMCSSValueInternal.h: * DOM/DOMCSSValueList.mm: * DOM/DOMCounter.mm: (kit): * DOM/DOMCounterInternal.h: * DOM/DOMRGBColor.mm: (kit): * DOM/DOMRGBColorInternal.h: * DOM/DOMRect.mm: (kit): * DOM/DOMRectInternal.h: * DOM/DOMUtility.mm: (createDOMWrapper): Source/WebKit2: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapCSSValue): (webkit_dom_css_value_constructor): (webkit_dom_css_value_get_css_text): (webkit_dom_css_value_set_css_text): (webkit_dom_css_value_get_css_value_type): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h: Canonical link: https://commits.webkit.org/183599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-17 20:08:34 +00:00
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DeprecatedCSSOMValue.h"
#include "DeprecatedCSSOMPrimitiveValue.h"
#include "DeprecatedCSSOMValueList.h"
namespace WebCore {
void DeprecatedCSSOMValue::destroy()
{
switch (classType()) {
case DeprecatedComplexValueClass: {
delete downcast<DeprecatedCSSOMComplexValue>(this);
return;
}
case DeprecatedPrimitiveValueClass: {
delete downcast<DeprecatedCSSOMPrimitiveValue>(this);
return;
}
case DeprecatedValueListClass: {
delete downcast<DeprecatedCSSOMValueList>(this);
return;
}
}
ASSERT_NOT_REACHED();
delete this;
}
unsigned DeprecatedCSSOMValue::cssValueType() const
{
switch (m_classType) {
case DeprecatedComplexValueClass:
return downcast<DeprecatedCSSOMComplexValue>(*this).cssValueType();
case DeprecatedPrimitiveValueClass:
Handle custom identifiers and strings separately, so we can quote strings correctly consistently https://bugs.webkit.org/show_bug.cgi?id=226694 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/css/css-animations/parsing/animation-name-valid-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-computed-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-shorthand-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt: * web-platform-tests/css/css-lists/parsing/content-invalid-expected.txt: * web-platform-tests/css/css-transitions/transition-property-002-expected.txt: * web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt: * web-platform-tests/css/cssom/serialize-values-expected.txt: Rebased to reflect progressions. In some cases the entire test passes, in other cases we still have failures, but the string serialization part of the test has progressed. Source/WebCore: Progressions in a number of WPT tests. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::CSSAnimation): Update since Animation::name() now returns a struct. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::OrderedNamedLinesCollector::appendLines const): Use createCustomIdent for line names. (WebCore::valueForGridPosition): Use createCustomIdent for grid line name. (WebCore::createTransitionPropertyValue): Use createCustomIdent for animation property names. (WebCore::counterToCSSValue): Use createCustomIdent for counter names. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Use createCustomIdent for list-style-type, locale, animation names if they were created from a custom-ident, and line-grid. * css/CSSCustomIdentValue.cpp: Emptied out this file; we can delete it soon. * css/CSSCustomIdentValue.h: Ditto. * css/CSSMarkup.cpp: (WebCore::serializeCharacterAsCodePoint): Optimized to do a single StringBuilder::append call. (WebCore::serializeAsStringOrCustomIdent): Deleted. * css/CSSMarkup.h: Removed serializeAsStringOrCustomIdent. * css/CSSPrimitiveValue.cpp: (WebCore::isValidCSSUnitTypeForDoubleConversion): Added a case for CustomIdent. Changed CSS_IDENT to assert not reached, since it should never be passed to this function. More cleanup of CSSUnitType is needed, but for now mostly leaving it alone. (WebCore::isStringType): Added a case for CustomIdent. Moved CSS_DIMENSION, which was incorrectly returning true, to return false. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::primitiveType const): Added transformation from CustomIdent to CSS_IDENT as we do with CSS_PROPERTY_ID and CSS_VALUE_ID. (WebCore::CSSPrimitiveValue::cleanup): Added a case for CustomIdent. Moved CSS_DIMENSION to the correct section. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::setFloatValue): Deleted. (WebCore::CSSPrimitiveValue::setStringValue): Deleted. (WebCore::CSSPrimitiveValue::getStringValue const): Deleted. (WebCore::CSSPrimitiveValue::stringValue const): Added a case for CustomIdent. (WebCore::CSSPrimitiveValue::unitTypeString): Added a case for CustomIdent and an ASSERT_NOT_REACHED for invalid enumeration values. (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed inaccurate FIXME comment for CSS_DIMENSION and changed it to do something less wrong, but still incorrect. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Changed CSS_STRING case to always serializeAsString. Added a CustomIdent case that always serializes as an identifier. (WebCore::CSSPrimitiveValue::equals const): Moved the CSS_DIMENSION to the correct part of this switch statement. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Added case for CustomIdent. * css/CSSPrimitiveValue.h: Made isFontRelativeLength, isResolution, and isViewportPercentageLength private. Made those plus isLength all constexpr. Removed WEBCORE_EXPORT from primitiveType and getFloatValue: those needed to be exported when this was the web-exposed class, but that is now DeprecatedCSSOMPrimitiveValue. Deleted setFloatValue, setStringValue, and getStringValue for the same reason: those functions are now in DeprecatedCSSOMPrimitiveValue and don't need to be here. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationName): Updated to pass a boolean in to the animation name to keep track of whether it was created with a string or a custom-ident so we it can properly round-trip in computed style. This is required to pass some of the WPT tests, although I could not find clear guidance in the specification that this behavior is required. The same name with a string and custom-ident are equivalent in other ways. * css/CSSUnits.cpp: (WebCore::operator<<): Added a case for CustomIdent. * css/CSSUnits.h: Added CustomIdent. Added some FIXME about how we can change this in the future. It's a remnant of the past when these were part of our web-facing API, and this can be greatly cleaned up. * css/CSSValue.cpp: (WebCore::CSSValue::cssText const): Removed CSSCustomIdentValue.h, CustomIdentClass, CSSCustomIdentValue. We are not going to use a separate class for custom-ident, just a separate type of primitive value. (WebCore::CSSValue::destroy): Ditto. * css/CSSValue.h: Deleted isCustomIdentValue and CustomIdentClass. * css/CSSValueList.cpp: (WebCore::CSSValueList::customCSSText const): Tweaked algorithm to be slightly more efficient. * css/CSSValuePool.h: Added createCustomIdent. Later should remove the create function that takes a string value and a type and use separate named functions for the few different cases, but doing the new one this way for now. * css/DeprecatedCSSOMPrimitiveValue.cpp: (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): Rewrote this to be a switch that preserves the current behavior but no longer relies on the numeric values of CSSUnitType values. Added a FIXME about using CSS_UNKNOWN more: some of the numbers we are exposing to the web are doing no good. (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue const): Rewrote this to be a switch as above. Preserves current behavior but stops relying on CSSUnitType numeric values. (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue const): Ditto. By putting a switch on primitiveType here, we can enforce the desired exception behavior here, instead of getting it from CSSPrimitiveValue, and it's better for this class to deal with the legacy bindings issues. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): Ditto. * css/DeprecatedCSSOMPrimitiveValue.h: Removed unneeded cssValueType function. Made both setFloatValue and setStringValue simpler since they always raise an exception and we do not intend to change that. Also stop using protected since we have no classes derived from this. Could do more cleanup, but this is a start. * css/DeprecatedCSSOMValue.cpp: (WebCore::DeprecatedCSSOMValue::cssValueType const): Put the constant values, CSS_PRIMITIVE_VALUE and CSS_VALUE_LIST, here rather than calling member functions. * css/DeprecatedCSSOMValueList.cpp: (WebCore::DeprecatedCSSOMValueList::cssText const): Tweaked to make the code more efficient. * css/DeprecatedCSSOMValueList.h: Removed unneeded cssValueType function and const overload of item function. Also stop using protected since we have no classes derived from this. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): Fixed indentation to match WebKit style. (WebCore::featureWithValidDensity): Ditto. (WebCore::featureWithValidPositiveLength): Ditto. (WebCore::featureExpectingPositiveInteger): Ditto. (WebCore::featureWithPositiveNumber): Ditto. * css/calc/CSSCalcCategoryMapping.cpp: (WebCore::hasDoubleValue): Added a case for CustomIdent. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeWillChange): Removed comment saying we should use CSSCustomIdentValue since using a property ID for the value is great. (WebCore::consumeAnimationName): Removed comment saying we should use CSSCustomIdentValue here because that would be incorrect: we need to preserve and round-trip the fact that this was string, not custom-ident. (WebCore::consumeTransitionProperty): Remove special case for CSSValueAll that wasn't doing anything. Removed comment saying we should use CSSCustomIdentValue since using a value ID for the value is great. (WebCore::consumeAttr): Updated comment. (WebCore::isCustomIdentValue): Updated to work with the new primitive value. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomIdent): Use the new createCustomIdent and removed an outdated comment. While we might some day want to implement custom-ident differently, we won't need to change the code here to make that happen. * platform/animation/Animation.cpp: (WebCore::Animation::animationsMatch const): Update since m_name now is a struct. (WebCore::Animation::initialName): Update to return Name instead of String. (WebCore::operator<<): Update since name() now returns a struct. * platform/animation/Animation.h: Added the Name struct so we can store a boolean to indicate whether it's a string or custom-ident for round tripping. Update types and implementations of function and data members accordingly. * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::createGridPosition): Update code to expect custom-ident instead of string; they used to both be the same thing. * style/Styleable.cpp: (WebCore::shouldConsiderAnimation): Update since Animation::name() now returns a struct. Also got rid of unsuccessful attempt to optimize comparison againt the string "none"; later might be good to clean out that special case. (WebCore::Styleable::updateCSSAnimations const): Ditto. Tools: * TestRunnerShared/TestFeatures.cpp: (WTR::parseTestHeader): Fixed a missing quote that made a log message read strangely. LayoutTests: * TestExpectations: Removed expected failures from 13 css-counter-styles tests that are not currently failing. I had planned to work on making more of these pass, but first found I could fix them with a corrected custom-ident implementation. * css3/supports-expected.txt: Rebased. * css3/supports.html: Updated to expect the value of the content property to be a quoted string, rather than the old behavior, which was to leave the string unquoted if it happened to be a string with all characters legal for a custom-ident. New expectation is the correct behavior. * fast/css/alt-inherit-initial-expected.txt: Rebased. * fast/css/alt-inherit-initial.html: Updated to expect the value of the language property to be a custom-ident, and serialize unusual cases with custom-ident rules, not as a quoted string. New expectation is the correct behavior. * fast/css/content-language-comma-separated-list-expected.txt: Ditto. * fast/css/content-language-empty-expected.txt: Ditto. * fast/css/content-language-only-whitespace-expected.txt: Ditto. * fast/css/content-language-with-whitespace-expected.txt: Ditto. * fast/css/getComputedStyle/computed-style-properties-expected.txt: Rebased. * fast/css/getComputedStyle/computed-style-properties.html: Expect content string (see above). * fast/css/lang-mapped-to-webkit-locale-expected.txt: Rebased. * fast/css/lang-mapped-to-webkit-locale.xhtml: Expect language custom-ident (see above). * fast/css/nested-at-rules-expected.txt: Rebased. * fast/css/nested-at-rules.html: Expect content string (see above). * fast/css/parsing-text-emphasis-expected.txt: Rebased. * fast/css/parsing-text-emphasis.html: Updated to expect strings to remaing quoted strings in the text-emphasis property, not change into custom-ident if all characters happen to fit. * fast/encoding/css-charset-default-expected.txt: Expect content string (see above). * inspector/css/pseudo-element-matches-for-pseudo-element-node-expected.txt: Ditto. Canonical link: https://commits.webkit.org/238538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 02:39:33 +00:00
return CSS_PRIMITIVE_VALUE;
[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM https://bugs.webkit.org/show_bug.cgi?id=165968 Reviewed by Andreas Kling. Source/WebCore: This patch changes the CSS OM for values to use distinct wrapper classes instead of cloning the existing classes. By actually wrapping values instead of cloning, we are freed up to change our CSS value hierarchy however we'd like (such as changing to match the new CSS Values OM that is coming soon). All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM" to reflect our desire (ultimately) to remove this API from our tree. We're the only ones that support it, and it's not used on the Web, but it is part of the WebKitLegacy API and might be used internally. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/DOMWrapperWorld.h: * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): * bindings/js/JSCSSValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): (WebCore::JSDeprecatedCSSOMValueOwner::finalize): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted. (WebCore::JSCSSValueOwner::finalize): Deleted. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSComputedStyleDeclaration.h: * css/CSSGridLineNamesValue.cpp: (WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted. * css/CSSGridLineNamesValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::cloneForCSSOM): Deleted. * css/CSSImageSetValue.h: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper): (WebCore::CSSImageValue::cloneForCSSOM): Deleted. * css/CSSImageValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper): (WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted. * css/CSSPrimitiveValue.h: * css/CSSPrimitiveValue.idl: Removed. * css/CSSStyleDeclaration.h: * css/CSSStyleDeclaration.idl: * css/CSSValue.cpp: (WebCore::CSSValue::traverseSubresources): (WebCore::CSSValue::equals): (WebCore::CSSValue::cssText): (WebCore::CSSValue::destroy): (WebCore::CSSValue::createDeprecatedCSSOMWrapper): (): Deleted. (WebCore::CSSValue::cloneForCSSOM): Deleted. * css/CSSValue.h: (WebCore::CSSValue::CSSValue): (WebCore::CSSValue::setCssText): Deleted. (WebCore::CSSValue::isCSSOMSafe): Deleted. (WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted. * css/CSSValue.idl: Removed. * css/CSSValueList.cpp: (WebCore::CSSValueList::cloneForCSSOM): Deleted. * css/CSSValueList.h: (WebCore::CSSValueList::separator): * css/CSSValueList.idl: Removed. * css/Counter.h: * css/Counter.idl: Removed. * css/DeprecatedCSSOMCounter.h: Added. * css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl. * css/DeprecatedCSSOMPrimitiveValue.cpp: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue): * css/DeprecatedCSSOMPrimitiveValue.h: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::create): (WebCore::DeprecatedCSSOMPrimitiveValue::equals): (WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType): (WebCore::DeprecatedCSSOMPrimitiveValue::cssText): (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::stringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue): * css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl. * css/DeprecatedCSSOMRGBColor.h: Added. * css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl. * css/DeprecatedCSSOMRect.h: Added. * css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl. * css/DeprecatedCSSOMValue.cpp: Added. (WebCore::compareCSSOMValues): (WebCore::DeprecatedCSSOMValue::equals): (WebCore::DeprecatedCSSOMValue::destroy): (WebCore::DeprecatedCSSOMValue::cssValueType): (WebCore::DeprecatedCSSOMValue::cssText): * css/DeprecatedCSSOMValue.h: Added. (WebCore::DeprecatedCSSOMValue::deref): (WebCore::DeprecatedCSSOMValue::setCssText): (WebCore::DeprecatedCSSOMValue::operator==): (WebCore::DeprecatedCSSOMValue::isComplexValue): (WebCore::DeprecatedCSSOMValue::isPrimitiveValue): (WebCore::DeprecatedCSSOMValue::isValueList): (WebCore::DeprecatedCSSOMValue::classType): (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMComplexValue::create): (WebCore::DeprecatedCSSOMComplexValue::equals): (WebCore::DeprecatedCSSOMComplexValue::cssText): (WebCore::DeprecatedCSSOMComplexValue::cssValueType): (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue): * css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl. * css/DeprecatedCSSOMValueList.cpp: Added. (WebCore::DeprecatedCSSOMValueList::equals): (WebCore::DeprecatedCSSOMValueList::cssText): * css/DeprecatedCSSOMValueList.h: Added. (WebCore::DeprecatedCSSOMValueList::create): (WebCore::DeprecatedCSSOMValueList::cssValueType): (WebCore::DeprecatedCSSOMValueList::length): (WebCore::DeprecatedCSSOMValueList::item): (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): * css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl. * css/LengthRepeat.h: * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue): (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM): (WebCore::StyleRuleCSSStyleDeclaration::didMutate): (WebCore::InlineCSSStyleDeclaration::didMutate): (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted. * css/PropertySetCSSStyleDeclaration.h: * css/RGBColor.cpp: (WebCore::RGBColor::red): Deleted. (WebCore::RGBColor::green): Deleted. (WebCore::RGBColor::blue): Deleted. (WebCore::RGBColor::alpha): Deleted. * css/RGBColor.h: * css/RGBColor.idl: Removed. * css/Rect.h: (WebCore::RectBase::RectBase): * css/Rect.idl: Removed. * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): * svg/SVGElement.h: * svg/SVGElement.idl: Source/WebKit/mac: * DOM/DOMCSS.mm: (kitClass): * DOM/DOMCSSPrimitiveValue.mm: (-[DOMCSSPrimitiveValue getCounterValue]): (-[DOMCSSPrimitiveValue getRectValue]): (kit): * DOM/DOMCSSPrimitiveValueInternal.h: * DOM/DOMCSSStyleDeclaration.mm: * DOM/DOMCSSValue.mm: (kit): * DOM/DOMCSSValueInternal.h: * DOM/DOMCSSValueList.mm: * DOM/DOMCounter.mm: (kit): * DOM/DOMCounterInternal.h: * DOM/DOMRGBColor.mm: (kit): * DOM/DOMRGBColorInternal.h: * DOM/DOMRect.mm: (kit): * DOM/DOMRectInternal.h: * DOM/DOMUtility.mm: (createDOMWrapper): Source/WebKit2: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapCSSValue): (webkit_dom_css_value_constructor): (webkit_dom_css_value_get_css_text): (webkit_dom_css_value_set_css_text): (webkit_dom_css_value_get_css_value_type): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h: Canonical link: https://commits.webkit.org/183599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-17 20:08:34 +00:00
case DeprecatedValueListClass:
Handle custom identifiers and strings separately, so we can quote strings correctly consistently https://bugs.webkit.org/show_bug.cgi?id=226694 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/css/css-animations/parsing/animation-name-valid-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-computed-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-shorthand-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt: * web-platform-tests/css/css-lists/parsing/content-invalid-expected.txt: * web-platform-tests/css/css-transitions/transition-property-002-expected.txt: * web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt: * web-platform-tests/css/cssom/serialize-values-expected.txt: Rebased to reflect progressions. In some cases the entire test passes, in other cases we still have failures, but the string serialization part of the test has progressed. Source/WebCore: Progressions in a number of WPT tests. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::CSSAnimation): Update since Animation::name() now returns a struct. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::OrderedNamedLinesCollector::appendLines const): Use createCustomIdent for line names. (WebCore::valueForGridPosition): Use createCustomIdent for grid line name. (WebCore::createTransitionPropertyValue): Use createCustomIdent for animation property names. (WebCore::counterToCSSValue): Use createCustomIdent for counter names. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Use createCustomIdent for list-style-type, locale, animation names if they were created from a custom-ident, and line-grid. * css/CSSCustomIdentValue.cpp: Emptied out this file; we can delete it soon. * css/CSSCustomIdentValue.h: Ditto. * css/CSSMarkup.cpp: (WebCore::serializeCharacterAsCodePoint): Optimized to do a single StringBuilder::append call. (WebCore::serializeAsStringOrCustomIdent): Deleted. * css/CSSMarkup.h: Removed serializeAsStringOrCustomIdent. * css/CSSPrimitiveValue.cpp: (WebCore::isValidCSSUnitTypeForDoubleConversion): Added a case for CustomIdent. Changed CSS_IDENT to assert not reached, since it should never be passed to this function. More cleanup of CSSUnitType is needed, but for now mostly leaving it alone. (WebCore::isStringType): Added a case for CustomIdent. Moved CSS_DIMENSION, which was incorrectly returning true, to return false. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::primitiveType const): Added transformation from CustomIdent to CSS_IDENT as we do with CSS_PROPERTY_ID and CSS_VALUE_ID. (WebCore::CSSPrimitiveValue::cleanup): Added a case for CustomIdent. Moved CSS_DIMENSION to the correct section. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::setFloatValue): Deleted. (WebCore::CSSPrimitiveValue::setStringValue): Deleted. (WebCore::CSSPrimitiveValue::getStringValue const): Deleted. (WebCore::CSSPrimitiveValue::stringValue const): Added a case for CustomIdent. (WebCore::CSSPrimitiveValue::unitTypeString): Added a case for CustomIdent and an ASSERT_NOT_REACHED for invalid enumeration values. (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed inaccurate FIXME comment for CSS_DIMENSION and changed it to do something less wrong, but still incorrect. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Changed CSS_STRING case to always serializeAsString. Added a CustomIdent case that always serializes as an identifier. (WebCore::CSSPrimitiveValue::equals const): Moved the CSS_DIMENSION to the correct part of this switch statement. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Added case for CustomIdent. * css/CSSPrimitiveValue.h: Made isFontRelativeLength, isResolution, and isViewportPercentageLength private. Made those plus isLength all constexpr. Removed WEBCORE_EXPORT from primitiveType and getFloatValue: those needed to be exported when this was the web-exposed class, but that is now DeprecatedCSSOMPrimitiveValue. Deleted setFloatValue, setStringValue, and getStringValue for the same reason: those functions are now in DeprecatedCSSOMPrimitiveValue and don't need to be here. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationName): Updated to pass a boolean in to the animation name to keep track of whether it was created with a string or a custom-ident so we it can properly round-trip in computed style. This is required to pass some of the WPT tests, although I could not find clear guidance in the specification that this behavior is required. The same name with a string and custom-ident are equivalent in other ways. * css/CSSUnits.cpp: (WebCore::operator<<): Added a case for CustomIdent. * css/CSSUnits.h: Added CustomIdent. Added some FIXME about how we can change this in the future. It's a remnant of the past when these were part of our web-facing API, and this can be greatly cleaned up. * css/CSSValue.cpp: (WebCore::CSSValue::cssText const): Removed CSSCustomIdentValue.h, CustomIdentClass, CSSCustomIdentValue. We are not going to use a separate class for custom-ident, just a separate type of primitive value. (WebCore::CSSValue::destroy): Ditto. * css/CSSValue.h: Deleted isCustomIdentValue and CustomIdentClass. * css/CSSValueList.cpp: (WebCore::CSSValueList::customCSSText const): Tweaked algorithm to be slightly more efficient. * css/CSSValuePool.h: Added createCustomIdent. Later should remove the create function that takes a string value and a type and use separate named functions for the few different cases, but doing the new one this way for now. * css/DeprecatedCSSOMPrimitiveValue.cpp: (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): Rewrote this to be a switch that preserves the current behavior but no longer relies on the numeric values of CSSUnitType values. Added a FIXME about using CSS_UNKNOWN more: some of the numbers we are exposing to the web are doing no good. (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue const): Rewrote this to be a switch as above. Preserves current behavior but stops relying on CSSUnitType numeric values. (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue const): Ditto. By putting a switch on primitiveType here, we can enforce the desired exception behavior here, instead of getting it from CSSPrimitiveValue, and it's better for this class to deal with the legacy bindings issues. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): Ditto. * css/DeprecatedCSSOMPrimitiveValue.h: Removed unneeded cssValueType function. Made both setFloatValue and setStringValue simpler since they always raise an exception and we do not intend to change that. Also stop using protected since we have no classes derived from this. Could do more cleanup, but this is a start. * css/DeprecatedCSSOMValue.cpp: (WebCore::DeprecatedCSSOMValue::cssValueType const): Put the constant values, CSS_PRIMITIVE_VALUE and CSS_VALUE_LIST, here rather than calling member functions. * css/DeprecatedCSSOMValueList.cpp: (WebCore::DeprecatedCSSOMValueList::cssText const): Tweaked to make the code more efficient. * css/DeprecatedCSSOMValueList.h: Removed unneeded cssValueType function and const overload of item function. Also stop using protected since we have no classes derived from this. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): Fixed indentation to match WebKit style. (WebCore::featureWithValidDensity): Ditto. (WebCore::featureWithValidPositiveLength): Ditto. (WebCore::featureExpectingPositiveInteger): Ditto. (WebCore::featureWithPositiveNumber): Ditto. * css/calc/CSSCalcCategoryMapping.cpp: (WebCore::hasDoubleValue): Added a case for CustomIdent. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeWillChange): Removed comment saying we should use CSSCustomIdentValue since using a property ID for the value is great. (WebCore::consumeAnimationName): Removed comment saying we should use CSSCustomIdentValue here because that would be incorrect: we need to preserve and round-trip the fact that this was string, not custom-ident. (WebCore::consumeTransitionProperty): Remove special case for CSSValueAll that wasn't doing anything. Removed comment saying we should use CSSCustomIdentValue since using a value ID for the value is great. (WebCore::consumeAttr): Updated comment. (WebCore::isCustomIdentValue): Updated to work with the new primitive value. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomIdent): Use the new createCustomIdent and removed an outdated comment. While we might some day want to implement custom-ident differently, we won't need to change the code here to make that happen. * platform/animation/Animation.cpp: (WebCore::Animation::animationsMatch const): Update since m_name now is a struct. (WebCore::Animation::initialName): Update to return Name instead of String. (WebCore::operator<<): Update since name() now returns a struct. * platform/animation/Animation.h: Added the Name struct so we can store a boolean to indicate whether it's a string or custom-ident for round tripping. Update types and implementations of function and data members accordingly. * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::createGridPosition): Update code to expect custom-ident instead of string; they used to both be the same thing. * style/Styleable.cpp: (WebCore::shouldConsiderAnimation): Update since Animation::name() now returns a struct. Also got rid of unsuccessful attempt to optimize comparison againt the string "none"; later might be good to clean out that special case. (WebCore::Styleable::updateCSSAnimations const): Ditto. Tools: * TestRunnerShared/TestFeatures.cpp: (WTR::parseTestHeader): Fixed a missing quote that made a log message read strangely. LayoutTests: * TestExpectations: Removed expected failures from 13 css-counter-styles tests that are not currently failing. I had planned to work on making more of these pass, but first found I could fix them with a corrected custom-ident implementation. * css3/supports-expected.txt: Rebased. * css3/supports.html: Updated to expect the value of the content property to be a quoted string, rather than the old behavior, which was to leave the string unquoted if it happened to be a string with all characters legal for a custom-ident. New expectation is the correct behavior. * fast/css/alt-inherit-initial-expected.txt: Rebased. * fast/css/alt-inherit-initial.html: Updated to expect the value of the language property to be a custom-ident, and serialize unusual cases with custom-ident rules, not as a quoted string. New expectation is the correct behavior. * fast/css/content-language-comma-separated-list-expected.txt: Ditto. * fast/css/content-language-empty-expected.txt: Ditto. * fast/css/content-language-only-whitespace-expected.txt: Ditto. * fast/css/content-language-with-whitespace-expected.txt: Ditto. * fast/css/getComputedStyle/computed-style-properties-expected.txt: Rebased. * fast/css/getComputedStyle/computed-style-properties.html: Expect content string (see above). * fast/css/lang-mapped-to-webkit-locale-expected.txt: Rebased. * fast/css/lang-mapped-to-webkit-locale.xhtml: Expect language custom-ident (see above). * fast/css/nested-at-rules-expected.txt: Rebased. * fast/css/nested-at-rules.html: Expect content string (see above). * fast/css/parsing-text-emphasis-expected.txt: Rebased. * fast/css/parsing-text-emphasis.html: Updated to expect strings to remaing quoted strings in the text-emphasis property, not change into custom-ident if all characters happen to fit. * fast/encoding/css-charset-default-expected.txt: Expect content string (see above). * inspector/css/pseudo-element-matches-for-pseudo-element-node-expected.txt: Ditto. Canonical link: https://commits.webkit.org/238538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 02:39:33 +00:00
return CSS_VALUE_LIST;
[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM https://bugs.webkit.org/show_bug.cgi?id=165968 Reviewed by Andreas Kling. Source/WebCore: This patch changes the CSS OM for values to use distinct wrapper classes instead of cloning the existing classes. By actually wrapping values instead of cloning, we are freed up to change our CSS value hierarchy however we'd like (such as changing to match the new CSS Values OM that is coming soon). All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM" to reflect our desire (ultimately) to remove this API from our tree. We're the only ones that support it, and it's not used on the Web, but it is part of the WebKitLegacy API and might be used internally. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/DOMWrapperWorld.h: * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): * bindings/js/JSCSSValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): (WebCore::JSDeprecatedCSSOMValueOwner::finalize): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted. (WebCore::JSCSSValueOwner::finalize): Deleted. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSComputedStyleDeclaration.h: * css/CSSGridLineNamesValue.cpp: (WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted. * css/CSSGridLineNamesValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::cloneForCSSOM): Deleted. * css/CSSImageSetValue.h: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper): (WebCore::CSSImageValue::cloneForCSSOM): Deleted. * css/CSSImageValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper): (WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted. * css/CSSPrimitiveValue.h: * css/CSSPrimitiveValue.idl: Removed. * css/CSSStyleDeclaration.h: * css/CSSStyleDeclaration.idl: * css/CSSValue.cpp: (WebCore::CSSValue::traverseSubresources): (WebCore::CSSValue::equals): (WebCore::CSSValue::cssText): (WebCore::CSSValue::destroy): (WebCore::CSSValue::createDeprecatedCSSOMWrapper): (): Deleted. (WebCore::CSSValue::cloneForCSSOM): Deleted. * css/CSSValue.h: (WebCore::CSSValue::CSSValue): (WebCore::CSSValue::setCssText): Deleted. (WebCore::CSSValue::isCSSOMSafe): Deleted. (WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted. * css/CSSValue.idl: Removed. * css/CSSValueList.cpp: (WebCore::CSSValueList::cloneForCSSOM): Deleted. * css/CSSValueList.h: (WebCore::CSSValueList::separator): * css/CSSValueList.idl: Removed. * css/Counter.h: * css/Counter.idl: Removed. * css/DeprecatedCSSOMCounter.h: Added. * css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl. * css/DeprecatedCSSOMPrimitiveValue.cpp: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue): * css/DeprecatedCSSOMPrimitiveValue.h: Added. (WebCore::DeprecatedCSSOMPrimitiveValue::create): (WebCore::DeprecatedCSSOMPrimitiveValue::equals): (WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType): (WebCore::DeprecatedCSSOMPrimitiveValue::cssText): (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::stringValue): (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue): * css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl. * css/DeprecatedCSSOMRGBColor.h: Added. * css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl. * css/DeprecatedCSSOMRect.h: Added. * css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl. * css/DeprecatedCSSOMValue.cpp: Added. (WebCore::compareCSSOMValues): (WebCore::DeprecatedCSSOMValue::equals): (WebCore::DeprecatedCSSOMValue::destroy): (WebCore::DeprecatedCSSOMValue::cssValueType): (WebCore::DeprecatedCSSOMValue::cssText): * css/DeprecatedCSSOMValue.h: Added. (WebCore::DeprecatedCSSOMValue::deref): (WebCore::DeprecatedCSSOMValue::setCssText): (WebCore::DeprecatedCSSOMValue::operator==): (WebCore::DeprecatedCSSOMValue::isComplexValue): (WebCore::DeprecatedCSSOMValue::isPrimitiveValue): (WebCore::DeprecatedCSSOMValue::isValueList): (WebCore::DeprecatedCSSOMValue::classType): (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMComplexValue::create): (WebCore::DeprecatedCSSOMComplexValue::equals): (WebCore::DeprecatedCSSOMComplexValue::cssText): (WebCore::DeprecatedCSSOMComplexValue::cssValueType): (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue): * css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl. * css/DeprecatedCSSOMValueList.cpp: Added. (WebCore::DeprecatedCSSOMValueList::equals): (WebCore::DeprecatedCSSOMValueList::cssText): * css/DeprecatedCSSOMValueList.h: Added. (WebCore::DeprecatedCSSOMValueList::create): (WebCore::DeprecatedCSSOMValueList::cssValueType): (WebCore::DeprecatedCSSOMValueList::length): (WebCore::DeprecatedCSSOMValueList::item): (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): * css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl. * css/LengthRepeat.h: * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue): (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM): (WebCore::StyleRuleCSSStyleDeclaration::didMutate): (WebCore::InlineCSSStyleDeclaration::didMutate): (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted. * css/PropertySetCSSStyleDeclaration.h: * css/RGBColor.cpp: (WebCore::RGBColor::red): Deleted. (WebCore::RGBColor::green): Deleted. (WebCore::RGBColor::blue): Deleted. (WebCore::RGBColor::alpha): Deleted. * css/RGBColor.h: * css/RGBColor.idl: Removed. * css/Rect.h: (WebCore::RectBase::RectBase): * css/Rect.idl: Removed. * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): * svg/SVGElement.h: * svg/SVGElement.idl: Source/WebKit/mac: * DOM/DOMCSS.mm: (kitClass): * DOM/DOMCSSPrimitiveValue.mm: (-[DOMCSSPrimitiveValue getCounterValue]): (-[DOMCSSPrimitiveValue getRectValue]): (kit): * DOM/DOMCSSPrimitiveValueInternal.h: * DOM/DOMCSSStyleDeclaration.mm: * DOM/DOMCSSValue.mm: (kit): * DOM/DOMCSSValueInternal.h: * DOM/DOMCSSValueList.mm: * DOM/DOMCounter.mm: (kit): * DOM/DOMCounterInternal.h: * DOM/DOMRGBColor.mm: (kit): * DOM/DOMRGBColorInternal.h: * DOM/DOMRect.mm: (kit): * DOM/DOMRectInternal.h: * DOM/DOMUtility.mm: (createDOMWrapper): Source/WebKit2: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapCSSValue): (webkit_dom_css_value_constructor): (webkit_dom_css_value_get_css_text): (webkit_dom_css_value_set_css_text): (webkit_dom_css_value_get_css_value_type): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h: Canonical link: https://commits.webkit.org/183599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-17 20:08:34 +00:00
}
ASSERT_NOT_REACHED();
return CSS_CUSTOM;
}
String DeprecatedCSSOMValue::cssText() const
{
switch (m_classType) {
case DeprecatedComplexValueClass:
return downcast<DeprecatedCSSOMComplexValue>(*this).cssText();
case DeprecatedPrimitiveValueClass:
return downcast<DeprecatedCSSOMPrimitiveValue>(*this).cssText();
case DeprecatedValueListClass:
return downcast<DeprecatedCSSOMValueList>(*this).cssText();
}
ASSERT_NOT_REACHED();
return "";
}
}