source: webkit/trunk/Source/WebCore/css/Counter.h

Last change on this file was 209969, checked in by [email protected], 8 years ago

[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:
  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/*
2 * (C) 1999-2003 Lars Knoll ([email protected])
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#pragma once
22
23#include "CSSPrimitiveValue.h"
24#include <wtf/text/WTFString.h>
25
26namespace WebCore {
27
28class Counter final : public RefCounted<Counter> {
29public:
30 static Ref<Counter> create(Ref<CSSPrimitiveValue>&& identifier, Ref<CSSPrimitiveValue>&& listStyle, Ref<CSSPrimitiveValue>&& separator)
31 {
32 return adoptRef(*new Counter(WTFMove(identifier), WTFMove(listStyle), WTFMove(separator)));
33 }
34
35 String identifier() const { return m_identifier->stringValue(); }
36 String listStyle() const { return m_listStyle->stringValue(); }
37 String separator() const { return m_separator->stringValue(); }
38
39 const CSSPrimitiveValue& identifierValue() const { return m_identifier; }
40 const CSSPrimitiveValue& listStyleValue() const { return m_listStyle; }
41 const CSSPrimitiveValue& separatorValue() const { return m_separator; }
42
43 CSSValueID listStyleIdent() const { return m_listStyle->valueID(); }
44
45 void setIdentifier(Ref<CSSPrimitiveValue>&& identifier) { m_identifier = WTFMove(identifier); }
46 void setListStyle(Ref<CSSPrimitiveValue>&& listStyle) { m_listStyle = WTFMove(listStyle); }
47 void setSeparator(Ref<CSSPrimitiveValue>&& separator) { m_separator = WTFMove(separator); }
48
49 bool equals(const Counter& other) const
50 {
51 return identifier() == other.identifier()
52 && listStyle() == other.listStyle()
53 && separator() == other.separator();
54 }
55
56private:
57 Counter(Ref<CSSPrimitiveValue>&& identifier, Ref<CSSPrimitiveValue>&& listStyle, Ref<CSSPrimitiveValue>&& separator)
58 : m_identifier(WTFMove(identifier))
59 , m_listStyle(WTFMove(listStyle))
60 , m_separator(WTFMove(separator))
61 {
62 }
63
64 Ref<CSSPrimitiveValue> m_identifier; // string
65 Ref<CSSPrimitiveValue> m_listStyle; // ident
66 Ref<CSSPrimitiveValue> m_separator; // string
67};
68
69} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.