Remove the CSSOM. This leaves CSSValue, but removes everything else. R=ojan@chromium.org Review URL: https://codereview.chromium.org/780483002
diff --git a/sky/engine/bindings/core/v8/custom/V8CSSRuleCustom.cpp b/sky/engine/bindings/core/v8/custom/V8CSSRuleCustom.cpp deleted file mode 100644 index 17796e0..0000000 --- a/sky/engine/bindings/core/v8/custom/V8CSSRuleCustom.cpp +++ /dev/null
@@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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 "sky/engine/config.h" -#include "bindings/core/v8/V8CSSRule.h" - -#include "bindings/core/v8/V8CSSFilterRule.h" -#include "bindings/core/v8/V8CSSFontFaceRule.h" -#include "bindings/core/v8/V8CSSKeyframeRule.h" -#include "bindings/core/v8/V8CSSKeyframesRule.h" -#include "bindings/core/v8/V8CSSMediaRule.h" -#include "bindings/core/v8/V8CSSStyleRule.h" -#include "bindings/core/v8/V8CSSSupportsRule.h" - -namespace blink { - -v8::Handle<v8::Object> wrap(CSSRule* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) -{ - ASSERT(impl); - switch (impl->type()) { - case CSSRule::UNKNOWN_RULE: - // CSSUnknownRule.idl is explicitly excluded as it doesn't add anything - // over CSSRule.idl (see core/core.gypi: 'core_idl_files'). - // -> Use the base class wrapper here. - return V8CSSRule::createWrapper(impl, creationContext, isolate); - case CSSRule::STYLE_RULE: - return wrap(toCSSStyleRule(impl), creationContext, isolate); - case CSSRule::MEDIA_RULE: - return wrap(toCSSMediaRule(impl), creationContext, isolate); - case CSSRule::FONT_FACE_RULE: - return wrap(toCSSFontFaceRule(impl), creationContext, isolate); - case CSSRule::KEYFRAME_RULE: - return wrap(toCSSKeyframeRule(impl), creationContext, isolate); - case CSSRule::KEYFRAMES_RULE: - return wrap(toCSSKeyframesRule(impl), creationContext, isolate); - case CSSRule::SUPPORTS_RULE: - return wrap(toCSSSupportsRule(impl), creationContext, isolate); - case CSSRule::WEBKIT_FILTER_RULE: - return wrap(toCSSFilterRule(impl), creationContext, isolate); - } - return V8CSSRule::createWrapper(impl, creationContext, isolate); -} - -} // namespace blink
diff --git a/sky/engine/bindings/core/v8/custom/V8StyleSheetCustom.cpp b/sky/engine/bindings/core/v8/custom/V8StyleSheetCustom.cpp deleted file mode 100644 index 31f2a4b..0000000 --- a/sky/engine/bindings/core/v8/custom/V8StyleSheetCustom.cpp +++ /dev/null
@@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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 "sky/engine/config.h" -#include "bindings/core/v8/V8StyleSheet.h" - -#include "bindings/core/v8/V8CSSStyleSheet.h" -#include "bindings/core/v8/V8Node.h" -#include "sky/engine/bindings/core/v8/V8DOMWrapper.h" - -namespace blink { - -v8::Handle<v8::Object> wrap(StyleSheet* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) -{ - ASSERT(impl); - if (impl->isCSSStyleSheet()) - return wrap(toCSSStyleSheet(impl), creationContext, isolate); - return V8StyleSheet::createWrapper(impl, creationContext, isolate); -} - -} // namespace blink
diff --git a/sky/engine/bindings/core/v8/custom/custom.gypi b/sky/engine/bindings/core/v8/custom/custom.gypi index b523411..5b2d181 100644 --- a/sky/engine/bindings/core/v8/custom/custom.gypi +++ b/sky/engine/bindings/core/v8/custom/custom.gypi
@@ -10,7 +10,6 @@ 'V8ArrayBufferViewCustom.cpp', 'V8ArrayBufferViewCustom.h', 'V8CanvasRenderingContext2DCustom.cpp', - 'V8CSSRuleCustom.cpp', 'V8CSSStyleDeclarationCustom.cpp', 'V8CSSValueCustom.cpp', 'V8CustomEventCustom.cpp', @@ -36,7 +35,6 @@ 'V8MutationObserverCustom.cpp', 'V8NodeCustom.cpp', 'V8PopStateEventCustom.cpp', - 'V8StyleSheetCustom.cpp', 'V8TypedArrayCustom.h', 'V8Uint16ArrayCustom.h', 'V8Uint32ArrayCustom.h',
diff --git a/sky/engine/core/animation/css/CSSAnimations.cpp b/sky/engine/core/animation/css/CSSAnimations.cpp index 44d0679..c682af4 100644 --- a/sky/engine/core/animation/css/CSSAnimations.cpp +++ b/sky/engine/core/animation/css/CSSAnimations.cpp
@@ -38,9 +38,10 @@ #include "sky/engine/core/animation/LegacyStyleInterpolation.h" #include "sky/engine/core/animation/css/CSSAnimatableValueFactory.h" #include "sky/engine/core/animation/css/CSSPropertyEquality.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" #include "sky/engine/core/css/CSSPropertyMetadata.h" #include "sky/engine/core/css/CSSValueList.h" +#include "sky/engine/core/css/StyleKeyframe.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" #include "sky/engine/core/css/resolver/CSSToStyleMap.h" #include "sky/engine/core/css/resolver/StyleResolver.h" #include "sky/engine/core/dom/Element.h"
diff --git a/sky/engine/core/core.gni b/sky/engine/core/core.gni index ef64f18..d309688 100644 --- a/sky/engine/core/core.gni +++ b/sky/engine/core/core.gni
@@ -138,14 +138,10 @@ "css/CSSCursorImageValue.cpp", "css/CSSCursorImageValue.h", "css/CSSCustomFontData.h", - "css/CSSFilterRule.cpp", - "css/CSSFilterRule.h", "css/CSSFilterValue.cpp", "css/CSSFilterValue.h", "css/CSSFontFace.cpp", "css/CSSFontFace.h", - "css/CSSFontFaceRule.cpp", - "css/CSSFontFaceRule.h", "css/CSSFontFaceSource.cpp", "css/CSSFontFaceSource.h", "css/CSSFontFaceSrcValue.cpp", @@ -161,8 +157,6 @@ "css/CSSFunctionValue.h", "css/CSSGradientValue.cpp", "css/CSSGradientValue.h", - "css/CSSGroupingRule.cpp", - "css/CSSGroupingRule.h", "css/CSSHelper.h", "css/CSSImageGeneratorValue.cpp", "css/CSSImageGeneratorValue.h", @@ -174,18 +168,12 @@ "css/CSSInheritedValue.h", "css/CSSInitialValue.cpp", "css/CSSInitialValue.h", - "css/CSSKeyframeRule.cpp", - "css/CSSKeyframeRule.h", - "css/CSSKeyframesRule.cpp", - "css/CSSKeyframesRule.h", "css/CSSLineBoxContainValue.cpp", "css/CSSLineBoxContainValue.h", "css/CSSMarkup.cpp", "css/CSSMarkup.h", "css/CSSMatrix.cpp", "css/CSSMatrix.h", - "css/CSSMediaRule.cpp", - "css/CSSMediaRule.h", "css/CSSOMUtils.cpp", "css/CSSOMUtils.h", "css/CSSPrimitiveValue.cpp", @@ -196,10 +184,6 @@ "css/CSSPropertyMetadata.h", "css/CSSPropertySourceData.cpp", "css/CSSPropertySourceData.h", - "css/CSSRule.cpp", - "css/CSSRule.h", - "css/CSSRuleList.cpp", - "css/CSSRuleList.h", "css/CSSSegmentedFontFace.cpp", "css/CSSSegmentedFontFace.h", "css/CSSSelector.cpp", @@ -209,12 +193,8 @@ "css/CSSShadowValue.cpp", "css/CSSShadowValue.h", "css/CSSStyleDeclaration.h", - "css/CSSStyleRule.cpp", - "css/CSSStyleRule.h", "css/CSSStyleSheet.cpp", "css/CSSStyleSheet.h", - "css/CSSSupportsRule.cpp", - "css/CSSSupportsRule.h", "css/CSSTimingFunctionValue.cpp", "css/CSSTimingFunctionValue.h", "css/CSSToLengthConversionData.cpp", @@ -223,7 +203,6 @@ "css/CSSTransformValue.h", "css/CSSUnicodeRangeValue.cpp", "css/CSSUnicodeRangeValue.h", - "css/CSSUnknownRule.h", "css/CSSValue.cpp", "css/CSSValue.h", "css/CSSValueList.cpp", @@ -359,12 +338,16 @@ "css/StylePropertyShorthandCustom.cpp", "css/StyleRule.cpp", "css/StyleRule.h", + "css/StyleKeyframe.h", + "css/StyleKeyframe.cpp", + "css/StyleRuleKeyframes.h", + "css/StyleRuleKeyframes.cpp", "css/StyleSheet.cpp", "css/StyleSheet.h", - "css/StyleSheetContents.cpp", - "css/StyleSheetContents.h", "css/StyleSheetList.cpp", "css/StyleSheetList.h", + "css/StyleSheetContents.cpp", + "css/StyleSheetContents.h", "dom/ActiveDOMObject.cpp", "dom/ActiveDOMObject.h", "dom/Attr.cpp", @@ -1296,36 +1279,22 @@ "app/Application.idl", "app/Module.idl", "css/CSS.idl", - "css/CSSFilterRule.idl", "css/CSSFilterValue.idl", - "css/CSSFontFaceRule.idl", - "css/CSSKeyframeRule.idl", - "css/CSSKeyframesRule.idl", "css/CSSMatrix.idl", - "css/CSSMediaRule.idl", "css/CSSPrimitiveValue.idl", - "css/CSSRule.idl", - "css/CSSRuleList.idl", "css/CSSStyleDeclaration.idl", - "css/CSSStyleRule.idl", - "css/CSSStyleSheet.idl", - "css/CSSSupportsRule.idl", "css/CSSTransformValue.idl", - "css/CSSUnknownRule.idl", "css/CSSValue.idl", "css/CSSValueList.idl", "css/FontFace.idl", "css/FontFaceSet.idl", "css/FontFaceSetForEachCallback.idl", "css/FontFaceSetLoadEvent.idl", - "css/MediaList.idl", "css/MediaQueryList.idl", "css/MediaQueryListEvent.idl", "css/Rect.idl", "css/RGBColor.idl", "css/StyleMedia.idl", - "css/StyleSheet.idl", - "css/StyleSheetList.idl", "dom/Attr.idl", "dom/CharacterData.idl", "dom/ClientRect.idl",
diff --git a/sky/engine/core/css/CSSComputedStyleDeclaration.cpp b/sky/engine/core/css/CSSComputedStyleDeclaration.cpp index 3768253..6ffbf81 100644 --- a/sky/engine/core/css/CSSComputedStyleDeclaration.cpp +++ b/sky/engine/core/css/CSSComputedStyleDeclaration.cpp
@@ -2361,11 +2361,6 @@ return MutableStylePropertySet::create(list.data(), list.size()); } -CSSRule* CSSComputedStyleDeclaration::parentRule() const -{ - return 0; -} - PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(const String& propertyName) { CSSPropertyID propertyID = cssPropertyID(propertyName);
diff --git a/sky/engine/core/css/CSSComputedStyleDeclaration.h b/sky/engine/core/css/CSSComputedStyleDeclaration.h index db0e839..d6ac265 100644 --- a/sky/engine/core/css/CSSComputedStyleDeclaration.h +++ b/sky/engine/core/css/CSSComputedStyleDeclaration.h
@@ -75,7 +75,6 @@ CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&); // CSSOM functions. Don't make these public. - virtual CSSRule* parentRule() const override; virtual unsigned length() const override; virtual String item(unsigned index) const override; PassRefPtr<RenderStyle> computeRenderStyle(CSSPropertyID) const;
diff --git a/sky/engine/core/css/CSSFilterRule.cpp b/sky/engine/core/css/CSSFilterRule.cpp deleted file mode 100644 index 1cb470d..0000000 --- a/sky/engine/core/css/CSSFilterRule.cpp +++ /dev/null
@@ -1,88 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 THE COPYRIGHT HOLDER 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 "sky/engine/config.h" -#include "sky/engine/core/css/CSSFilterRule.h" - -#include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h" -#include "sky/engine/core/css/StylePropertySet.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -CSSFilterRule::CSSFilterRule(StyleRuleFilter* filterRule, CSSStyleSheet* parent) - : CSSRule(parent) - , m_filterRule(filterRule) -{ -} - -CSSFilterRule::~CSSFilterRule() -{ -#if !ENABLE(OILPAN) - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->clearParentRule(); -#endif -} - -CSSStyleDeclaration* CSSFilterRule::style() const -{ - if (!m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_filterRule->mutableProperties(), const_cast<CSSFilterRule*>(this)); - return m_propertiesCSSOMWrapper.get(); -} - -String CSSFilterRule::cssText() const -{ - StringBuilder result; - result.appendLiteral("@-webkit-filter "); - - String filterName = m_filterRule->filterName(); - result.append(filterName); - result.appendLiteral(" { "); - - String descs = m_filterRule->properties().asText(); - result.append(descs); - if (!descs.isEmpty()) - result.append(' '); - result.append('}'); - - return result.toString(); -} - -void CSSFilterRule::reattach(StyleRuleBase* rule) -{ - ASSERT(rule); - m_filterRule = toStyleRuleFilter(rule); - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->reattach(m_filterRule->mutableProperties()); -} - -} // namespace blink -
diff --git a/sky/engine/core/css/CSSFilterRule.h b/sky/engine/core/css/CSSFilterRule.h deleted file mode 100644 index a42e99f..0000000 --- a/sky/engine/core/css/CSSFilterRule.h +++ /dev/null
@@ -1,68 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 THE COPYRIGHT HOLDER 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. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSFILTERRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSFILTERRULE_H_ - -#include "sky/engine/core/css/CSSRule.h" - -namespace blink { - -class CSSStyleDeclaration; -class StyleRuleFilter; -class StyleRuleCSSStyleDeclaration; - -class CSSFilterRule final : public CSSRule { -public: - static PassRefPtr<CSSFilterRule> create(StyleRuleFilter* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSFilterRule(rule, sheet)); - } - - virtual ~CSSFilterRule(); - - virtual CSSRule::Type type() const override { return WEBKIT_FILTER_RULE; } - virtual String cssText() const override; - virtual void reattach(StyleRuleBase*) override; - - CSSStyleDeclaration* style() const; - -private: - CSSFilterRule(StyleRuleFilter*, CSSStyleSheet* parent); - - RefPtr<StyleRuleFilter> m_filterRule; - mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSFilterRule, WEBKIT_FILTER_RULE); - -} - - -#endif // SKY_ENGINE_CORE_CSS_CSSFILTERRULE_H_
diff --git a/sky/engine/core/css/CSSFilterRule.idl b/sky/engine/core/css/CSSFilterRule.idl deleted file mode 100644 index 44d9581..0000000 --- a/sky/engine/core/css/CSSFilterRule.idl +++ /dev/null
@@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 THE COPYRIGHT HOLDER 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. - */ - -interface CSSFilterRule : CSSRule { - readonly attribute CSSStyleDeclaration style; - - // FIXME: We should expose the filter name once the CSSOM for the @filter rule is specified. -};
diff --git a/sky/engine/core/css/CSSFontFaceRule.cpp b/sky/engine/core/css/CSSFontFaceRule.cpp deleted file mode 100644 index 42ed646..0000000 --- a/sky/engine/core/css/CSSFontFaceRule.cpp +++ /dev/null
@@ -1,73 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/css/CSSFontFaceRule.h" - -#include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h" -#include "sky/engine/core/css/StylePropertySet.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -CSSFontFaceRule::CSSFontFaceRule(StyleRuleFontFace* fontFaceRule, CSSStyleSheet* parent) - : CSSRule(parent) - , m_fontFaceRule(fontFaceRule) -{ -} - -CSSFontFaceRule::~CSSFontFaceRule() -{ -#if !ENABLE(OILPAN) - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->clearParentRule(); -#endif -} - -CSSStyleDeclaration* CSSFontFaceRule::style() const -{ - if (!m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_fontFaceRule->mutableProperties(), const_cast<CSSFontFaceRule*>(this)); - return m_propertiesCSSOMWrapper.get(); -} - -String CSSFontFaceRule::cssText() const -{ - StringBuilder result; - result.appendLiteral("@font-face { "); - String descs = m_fontFaceRule->properties().asText(); - result.append(descs); - if (!descs.isEmpty()) - result.append(' '); - result.append('}'); - return result.toString(); -} - -void CSSFontFaceRule::reattach(StyleRuleBase* rule) -{ - ASSERT(rule); - m_fontFaceRule = toStyleRuleFontFace(rule); - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->mutableProperties()); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSFontFaceRule.h b/sky/engine/core/css/CSSFontFaceRule.h deleted file mode 100644 index 3861425..0000000 --- a/sky/engine/core/css/CSSFontFaceRule.h +++ /dev/null
@@ -1,61 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSFONTFACERULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSFONTFACERULE_H_ - -#include "sky/engine/core/css/CSSRule.h" - -namespace blink { - -class CSSStyleDeclaration; -class StyleRuleFontFace; -class StyleRuleCSSStyleDeclaration; - -class CSSFontFaceRule final : public CSSRule { -public: - static PassRefPtr<CSSFontFaceRule> create(StyleRuleFontFace* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSFontFaceRule(rule, sheet)); - } - - virtual ~CSSFontFaceRule(); - - virtual CSSRule::Type type() const override { return FONT_FACE_RULE; } - virtual String cssText() const override; - virtual void reattach(StyleRuleBase*) override; - - CSSStyleDeclaration* style() const; - - StyleRuleFontFace* styleRule() const { return m_fontFaceRule.get(); } - -private: - CSSFontFaceRule(StyleRuleFontFace*, CSSStyleSheet* parent); - - RefPtr<StyleRuleFontFace> m_fontFaceRule; - mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSFontFaceRule, FONT_FACE_RULE); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSFONTFACERULE_H_
diff --git a/sky/engine/core/css/CSSFontFaceRule.idl b/sky/engine/core/css/CSSFontFaceRule.idl deleted file mode 100644 index f13497c..0000000 --- a/sky/engine/core/css/CSSFontFaceRule.idl +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface CSSFontFaceRule : CSSRule { - readonly attribute CSSStyleDeclaration style; -}; -
diff --git a/sky/engine/core/css/CSSGroupingRule.cpp b/sky/engine/core/css/CSSGroupingRule.cpp deleted file mode 100644 index 97c244a..0000000 --- a/sky/engine/core/css/CSSGroupingRule.cpp +++ /dev/null
@@ -1,149 +0,0 @@ -/* - * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - * Copyright (C) 2012 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 THE COPYRIGHT HOLDER "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 THE COPYRIGHT HOLDER 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 "sky/engine/config.h" -#include "sky/engine/core/css/CSSGroupingRule.h" - -#include "sky/engine/bindings/core/v8/ExceptionState.h" -#include "sky/engine/core/css/CSSRuleList.h" -#include "sky/engine/core/css/CSSStyleSheet.h" -#include "sky/engine/core/css/parser/BisonCSSParser.h" -#include "sky/engine/core/dom/ExceptionCode.h" -#include "sky/engine/core/frame/UseCounter.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent) - : CSSRule(parent) - , m_groupRule(groupRule) - , m_childRuleCSSOMWrappers(groupRule->childRules().size()) -{ -} - -CSSGroupingRule::~CSSGroupingRule() -{ -#if !ENABLE(OILPAN) - ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); - for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { - if (m_childRuleCSSOMWrappers[i]) - m_childRuleCSSOMWrappers[i]->setParentRule(0); - } -#endif -} - -unsigned CSSGroupingRule::insertRule(const String& ruleString, unsigned index, ExceptionState& exceptionState) -{ - ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); - - if (index > m_groupRule->childRules().size()) { - exceptionState.throwDOMException(IndexSizeError, "the index " + String::number(index) + " must be less than or equal to the length of the rule list."); - return 0; - } - - CSSStyleSheet* styleSheet = parentStyleSheet(); - CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); - BisonCSSParser parser(context); - RefPtr<StyleRuleBase> newRule = parser.parseRule(styleSheet ? styleSheet->contents() : 0, ruleString); - if (!newRule) { - exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString + "' is invalid and cannot be parsed."); - return 0; - } - - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_groupRule->wrapperInsertRule(index, newRule); - - m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>(nullptr)); - return index; -} - -void CSSGroupingRule::deleteRule(unsigned index, ExceptionState& exceptionState) -{ - ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); - - if (index >= m_groupRule->childRules().size()) { - exceptionState.throwDOMException(IndexSizeError, "the index " + String::number(index) + " is greated than the length of the rule list."); - return; - } - - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_groupRule->wrapperRemoveRule(index); - - if (m_childRuleCSSOMWrappers[index]) - m_childRuleCSSOMWrappers[index]->setParentRule(0); - m_childRuleCSSOMWrappers.remove(index); -} - -void CSSGroupingRule::appendCSSTextForItems(StringBuilder& result) const -{ - unsigned size = length(); - for (unsigned i = 0; i < size; ++i) { - result.appendLiteral(" "); - result.append(item(i)->cssText()); - result.append('\n'); - } -} - -unsigned CSSGroupingRule::length() const -{ - return m_groupRule->childRules().size(); -} - -CSSRule* CSSGroupingRule::item(unsigned index) const -{ - if (index >= length()) - return 0; - ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); - RefPtr<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; - if (!rule) - rule = m_groupRule->childRules()[index]->createCSSOMWrapper(const_cast<CSSGroupingRule*>(this)); - return rule.get(); -} - -CSSRuleList* CSSGroupingRule::cssRules() const -{ - if (!m_ruleListCSSOMWrapper) - m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSGroupingRule>::create(const_cast<CSSGroupingRule*>(this)); - return m_ruleListCSSOMWrapper.get(); -} - -void CSSGroupingRule::reattach(StyleRuleBase* rule) -{ - ASSERT(rule); - m_groupRule = static_cast<StyleRuleGroup*>(rule); - for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { - if (m_childRuleCSSOMWrappers[i]) - m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].get()); - } -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSGroupingRule.h b/sky/engine/core/css/CSSGroupingRule.h deleted file mode 100644 index d6a54e5..0000000 --- a/sky/engine/core/css/CSSGroupingRule.h +++ /dev/null
@@ -1,62 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSGROUPINGRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSGROUPINGRULE_H_ - -#include "sky/engine/core/css/CSSRule.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/wtf/Vector.h" - -namespace blink { - -class ExceptionState; -class CSSRuleList; - -class CSSGroupingRule : public CSSRule { -public: - virtual ~CSSGroupingRule(); - - virtual void reattach(StyleRuleBase*) override; - - CSSRuleList* cssRules() const; - - unsigned insertRule(const String& rule, unsigned index, ExceptionState&); - void deleteRule(unsigned index, ExceptionState&); - - // For CSSRuleList - unsigned length() const; - CSSRule* item(unsigned index) const; - -protected: - CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* parent); - - void appendCSSTextForItems(StringBuilder&) const; - - RefPtr<StyleRuleGroup> m_groupRule; - mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; - mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSGROUPINGRULE_H_
diff --git a/sky/engine/core/css/CSSKeyframeRule.idl b/sky/engine/core/css/CSSKeyframeRule.idl deleted file mode 100644 index 671d243..0000000 --- a/sky/engine/core/css/CSSKeyframeRule.idl +++ /dev/null
@@ -1,36 +0,0 @@ -/* - * Copyright (C) 2008 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -// Introduced in DOM Level ?: -interface CSSKeyframeRule : CSSRule { - - attribute DOMString keyText; - readonly attribute CSSStyleDeclaration style; - -}; -
diff --git a/sky/engine/core/css/CSSKeyframesRule.cpp b/sky/engine/core/css/CSSKeyframesRule.cpp deleted file mode 100644 index e7e85b7..0000000 --- a/sky/engine/core/css/CSSKeyframesRule.cpp +++ /dev/null
@@ -1,207 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2012 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 COMPUTER, 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 COMPUTER, 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 "sky/engine/config.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" - -#include "sky/engine/core/css/CSSKeyframeRule.h" -#include "sky/engine/core/css/CSSRuleList.h" -#include "sky/engine/core/css/CSSStyleSheet.h" -#include "sky/engine/core/css/parser/BisonCSSParser.h" -#include "sky/engine/core/frame/UseCounter.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -StyleRuleKeyframes::StyleRuleKeyframes() - : StyleRuleBase(Keyframes) -{ -} - -StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) - : StyleRuleBase(o) - , m_keyframes(o.m_keyframes) - , m_name(o.m_name) - , m_isPrefixed(o.m_isPrefixed) -{ -} - -StyleRuleKeyframes::~StyleRuleKeyframes() -{ -} - -void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtr<StyleKeyframe> keyframe) -{ - if (!keyframe) - return; - m_keyframes.append(keyframe); -} - -void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtr<StyleKeyframe> keyframe) -{ - m_keyframes.append(keyframe); -} - -void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) -{ - m_keyframes.remove(index); -} - -int StyleRuleKeyframes::findKeyframeIndex(const String& key) const -{ - String percentageString; - if (equalIgnoringCase(key, "from")) - percentageString = "0%"; - else if (equalIgnoringCase(key, "to")) - percentageString = "100%"; - else - percentageString = key; - - for (unsigned i = 0; i < m_keyframes.size(); ++i) { - if (m_keyframes[i]->keyText() == percentageString) - return i; - } - return -1; -} - -CSSKeyframesRule::CSSKeyframesRule(StyleRuleKeyframes* keyframesRule, CSSStyleSheet* parent) - : CSSRule(parent) - , m_keyframesRule(keyframesRule) - , m_childRuleCSSOMWrappers(keyframesRule->keyframes().size()) - , m_isPrefixed(keyframesRule->isVendorPrefixed()) -{ -} - -CSSKeyframesRule::~CSSKeyframesRule() -{ -#if !ENABLE(OILPAN) - ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size()); - for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { - if (m_childRuleCSSOMWrappers[i]) - m_childRuleCSSOMWrappers[i]->setParentRule(0); - } -#endif -} - -void CSSKeyframesRule::setName(const String& name) -{ - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_keyframesRule->setName(name); -} - -void CSSKeyframesRule::insertRule(const String& ruleText) -{ - ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size()); - - CSSStyleSheet* styleSheet = parentStyleSheet(); - CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); - BisonCSSParser parser(context); - RefPtr<StyleKeyframe> keyframe = parser.parseKeyframeRule(styleSheet ? styleSheet->contents() : 0, ruleText); - if (!keyframe) - return; - - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_keyframesRule->wrapperAppendKeyframe(keyframe); - - m_childRuleCSSOMWrappers.grow(length()); -} - -void CSSKeyframesRule::deleteRule(const String& s) -{ - ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size()); - - int i = m_keyframesRule->findKeyframeIndex(s); - if (i < 0) - return; - - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_keyframesRule->wrapperRemoveKeyframe(i); - - if (m_childRuleCSSOMWrappers[i]) - m_childRuleCSSOMWrappers[i]->setParentRule(0); - m_childRuleCSSOMWrappers.remove(i); -} - -CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s) -{ - int i = m_keyframesRule->findKeyframeIndex(s); - return (i >= 0) ? item(i) : 0; -} - -String CSSKeyframesRule::cssText() const -{ - StringBuilder result; - if (isVendorPrefixed()) - result.appendLiteral("@-webkit-keyframes "); - else - result.appendLiteral("@keyframes "); - result.append(name()); - result.appendLiteral(" { \n"); - - unsigned size = length(); - for (unsigned i = 0; i < size; ++i) { - result.appendLiteral(" "); - result.append(m_keyframesRule->keyframes()[i]->cssText()); - result.append('\n'); - } - result.append('}'); - return result.toString(); -} - -unsigned CSSKeyframesRule::length() const -{ - return m_keyframesRule->keyframes().size(); -} - -CSSKeyframeRule* CSSKeyframesRule::item(unsigned index) const -{ - if (index >= length()) - return 0; - - ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size()); - RefPtr<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; - if (!rule) - rule = adoptRef(new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), const_cast<CSSKeyframesRule*>(this))); - - return rule.get(); -} - -CSSRuleList* CSSKeyframesRule::cssRules() -{ - if (!m_ruleListCSSOMWrapper) - m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSKeyframesRule>::create(this); - return m_ruleListCSSOMWrapper.get(); -} - -void CSSKeyframesRule::reattach(StyleRuleBase* rule) -{ - ASSERT(rule); - m_keyframesRule = toStyleRuleKeyframes(rule); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSKeyframesRule.idl b/sky/engine/core/css/CSSKeyframesRule.idl deleted file mode 100644 index d85f8d1..0000000 --- a/sky/engine/core/css/CSSKeyframesRule.idl +++ /dev/null
@@ -1,38 +0,0 @@ -/* - * Copyright (C) 2008 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -// Introduced in DOM Level ?: -interface CSSKeyframesRule : CSSRule { - attribute DOMString name; - readonly attribute CSSRuleList cssRules; - - [ImplementedAs=item, NotEnumerable] getter CSSKeyframeRule (unsigned long index); - void insertRule([Default=Undefined] optional DOMString rule); - void deleteRule([Default=Undefined] optional DOMString key); - CSSKeyframeRule findRule([Default=Undefined] optional DOMString key); -};
diff --git a/sky/engine/core/css/CSSMediaRule.cpp b/sky/engine/core/css/CSSMediaRule.cpp deleted file mode 100644 index c013b72..0000000 --- a/sky/engine/core/css/CSSMediaRule.cpp +++ /dev/null
@@ -1,79 +0,0 @@ -/** - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2012 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/css/CSSMediaRule.h" - -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -CSSMediaRule::CSSMediaRule(StyleRuleMedia* mediaRule, CSSStyleSheet* parent) - : CSSGroupingRule(mediaRule, parent) -{ -} - -CSSMediaRule::~CSSMediaRule() -{ -#if !ENABLE(OILPAN) - if (m_mediaCSSOMWrapper) - m_mediaCSSOMWrapper->clearParentRule(); -#endif -} - -MediaQuerySet* CSSMediaRule::mediaQueries() const -{ - return toStyleRuleMedia(m_groupRule.get())->mediaQueries(); -} - -String CSSMediaRule::cssText() const -{ - StringBuilder result; - result.appendLiteral("@media "); - if (mediaQueries()) { - result.append(mediaQueries()->mediaText()); - result.append(' '); - } - result.appendLiteral("{ \n"); - appendCSSTextForItems(result); - result.append('}'); - return result.toString(); -} - -MediaList* CSSMediaRule::media() const -{ - if (!mediaQueries()) - return 0; - if (!m_mediaCSSOMWrapper) - m_mediaCSSOMWrapper = MediaList::create(mediaQueries(), const_cast<CSSMediaRule*>(this)); - return m_mediaCSSOMWrapper.get(); -} - -void CSSMediaRule::reattach(StyleRuleBase* rule) -{ - CSSGroupingRule::reattach(rule); - if (m_mediaCSSOMWrapper && mediaQueries()) - m_mediaCSSOMWrapper->reattach(mediaQueries()); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSMediaRule.h b/sky/engine/core/css/CSSMediaRule.h deleted file mode 100644 index 59b30c4..0000000 --- a/sky/engine/core/css/CSSMediaRule.h +++ /dev/null
@@ -1,60 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSMEDIARULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSMEDIARULE_H_ - -#include "sky/engine/core/css/CSSGroupingRule.h" -#include "sky/engine/core/css/MediaList.h" - -namespace blink { - -class StyleRuleMedia; - -class CSSMediaRule final : public CSSGroupingRule { -public: - static PassRefPtr<CSSMediaRule> create(StyleRuleMedia* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSMediaRule(rule, sheet)); - } - - virtual ~CSSMediaRule(); - - virtual CSSRule::Type type() const override { return MEDIA_RULE; } - virtual void reattach(StyleRuleBase*) override; - virtual String cssText() const override; - - MediaList* media() const; - -private: - CSSMediaRule(StyleRuleMedia*, CSSStyleSheet*); - - MediaQuerySet* mediaQueries() const; - - mutable RefPtr<MediaList> m_mediaCSSOMWrapper; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSMediaRule, MEDIA_RULE); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSMEDIARULE_H_
diff --git a/sky/engine/core/css/CSSMediaRule.idl b/sky/engine/core/css/CSSMediaRule.idl deleted file mode 100644 index 0f1d76d..0000000 --- a/sky/engine/core/css/CSSMediaRule.idl +++ /dev/null
@@ -1,29 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface CSSMediaRule : CSSRule { - readonly attribute MediaList media; - readonly attribute CSSRuleList cssRules; - - [RaisesException] unsigned long insertRule(DOMString rule, unsigned long index); - [RaisesException] void deleteRule(unsigned long index); -}; -
diff --git a/sky/engine/core/css/CSSRule.cpp b/sky/engine/core/css/CSSRule.cpp deleted file mode 100644 index f89be13..0000000 --- a/sky/engine/core/css/CSSRule.cpp +++ /dev/null
@@ -1,63 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2007, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/css/CSSRule.h" - -#include "sky/engine/core/css/CSSStyleSheet.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/core/css/StyleSheetContents.h" -#include "sky/engine/platform/NotImplemented.h" - -namespace blink { - -// VC++ 2013 doesn't support EBCO (Empty Base Class Optimization), and having -// multiple empty base classes makes the size of CSSRule bloat (Note that both -// of GarbageCollectedFinalized and ScriptWrappableBase are empty classes). -// See the following article for details. -// http://social.msdn.microsoft.com/forums/vstudio/en-US/504c6598-6076-4acf-96b6-e6acb475d302/vc-multiple-inheritance-empty-base-classes-bloats-object-size -// -// FIXME: Remove ScriptWrappableBase from the base class list once VC++'s issue -// gets fixed. -// Note that we're going to split CSSRule class into two classes; CSSOMRule -// (assumed name) which derives ScriptWrappable and CSSRule (new one) which -// doesn't derive ScriptWrappable or ScriptWrappableBase. Then, we can safely -// remove ScriptWrappableBase from the base class list. -struct SameSizeAsCSSRule : public RefCounted<SameSizeAsCSSRule>, public ScriptWrappableBase { - virtual ~SameSizeAsCSSRule(); - unsigned char bitfields; - void* pointerUnion; -}; - -COMPILE_ASSERT(sizeof(CSSRule) == sizeof(SameSizeAsCSSRule), CSSRule_should_stay_small); - -void CSSRule::setCSSText(const String&) -{ - notImplemented(); -} - -const CSSParserContext& CSSRule::parserContext() const -{ - CSSStyleSheet* styleSheet = parentStyleSheet(); - return styleSheet ? styleSheet->contents()->parserContext() : strictCSSParserContext(); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSRule.h b/sky/engine/core/css/CSSRule.h deleted file mode 100644 index 7afce5d..0000000 --- a/sky/engine/core/css/CSSRule.h +++ /dev/null
@@ -1,109 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2007, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2011 Andreas Kling (kling@webkit.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSRULE_H_ - -#include "sky/engine/bindings/core/v8/ScriptWrappable.h" -#include "sky/engine/platform/heap/Handle.h" -#include "sky/engine/wtf/RefCounted.h" -#include "sky/engine/wtf/text/WTFString.h" - -namespace blink { - -class CSSParserContext; -class CSSStyleSheet; -class StyleRuleBase; - -class CSSRule : public RefCounted<CSSRule>, public ScriptWrappableBase { -public: - virtual ~CSSRule() { } - - enum Type { - UNKNOWN_RULE = 0, - STYLE_RULE = 1, - MEDIA_RULE = 4, - FONT_FACE_RULE = 5, - KEYFRAMES_RULE = 7, - KEYFRAME_RULE, - SUPPORTS_RULE = 12, - WEBKIT_FILTER_RULE = 17 - }; - - virtual Type type() const = 0; - virtual String cssText() const = 0; - virtual void reattach(StyleRuleBase*) = 0; - - void setParentStyleSheet(CSSStyleSheet* styleSheet) - { - m_parentIsRule = false; - m_parentStyleSheet = styleSheet; - } - - void setParentRule(CSSRule* rule) - { - m_parentIsRule = true; - m_parentRule = rule; - } - - CSSStyleSheet* parentStyleSheet() const - { - if (m_parentIsRule) - return m_parentRule ? m_parentRule->parentStyleSheet() : 0; - return m_parentStyleSheet; - } - - CSSRule* parentRule() const { return m_parentIsRule ? m_parentRule : 0; } - - // NOTE: Just calls notImplemented(). - void setCSSText(const String&); - -protected: - CSSRule(CSSStyleSheet* parent) - : m_hasCachedSelectorText(false) - , m_parentIsRule(false) - , m_parentStyleSheet(parent) - { - } - - bool hasCachedSelectorText() const { return m_hasCachedSelectorText; } - void setHasCachedSelectorText(bool hasCachedSelectorText) const { m_hasCachedSelectorText = hasCachedSelectorText; } - - const CSSParserContext& parserContext() const; - -private: - mutable unsigned char m_hasCachedSelectorText : 1; - unsigned char m_parentIsRule : 1; - - // These should be Members, but no Members in unions. - union { - CSSRule* m_parentRule; - CSSStyleSheet* m_parentStyleSheet; - }; -}; - -#define DEFINE_CSS_RULE_TYPE_CASTS(ToType, TYPE_NAME) \ - DEFINE_TYPE_CASTS(ToType, CSSRule, rule, rule->type() == CSSRule::TYPE_NAME, rule.type() == CSSRule::TYPE_NAME) - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSRULE_H_
diff --git a/sky/engine/core/css/CSSRule.idl b/sky/engine/core/css/CSSRule.idl deleted file mode 100644 index 09bb91c..0000000 --- a/sky/engine/core/css/CSSRule.idl +++ /dev/null
@@ -1,45 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - Custom=Wrap, - DependentLifetime, - NotScriptWrappable, -] interface CSSRule { - - // RuleType - const unsigned short UNKNOWN_RULE = 0; - const unsigned short STYLE_RULE = 1; - const unsigned short MEDIA_RULE = 4; - const unsigned short FONT_FACE_RULE = 5; - const unsigned short KEYFRAMES_RULE = 7; - const unsigned short KEYFRAME_RULE = 8; - const unsigned short SUPPORTS_RULE = 12; - const unsigned short WEBKIT_FILTER_RULE = 17; - - readonly attribute unsigned short type; - - attribute DOMString cssText; - - readonly attribute CSSStyleSheet parentStyleSheet; - readonly attribute CSSRule parentRule; - -};
diff --git a/sky/engine/core/css/CSSRuleList.cpp b/sky/engine/core/css/CSSRuleList.cpp deleted file mode 100644 index 6ea940f..0000000 --- a/sky/engine/core/css/CSSRuleList.cpp +++ /dev/null
@@ -1,53 +0,0 @@ -/** - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2012 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 - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/css/CSSRuleList.h" - -#include "sky/engine/core/css/CSSRule.h" - -namespace blink { - -CSSRuleList::CSSRuleList() -{ -} - -CSSRuleList::~CSSRuleList() -{ -} - -StaticCSSRuleList::StaticCSSRuleList() - : m_refCount(1) -{ -} - -StaticCSSRuleList::~StaticCSSRuleList() -{ -} - -void StaticCSSRuleList::deref() -{ - ASSERT(m_refCount); - if (!--m_refCount) - delete this; -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSRuleList.h b/sky/engine/core/css/CSSRuleList.h deleted file mode 100644 index 313b943..0000000 --- a/sky/engine/core/css/CSSRuleList.h +++ /dev/null
@@ -1,111 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2012 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 - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSRULELIST_H_ -#define SKY_ENGINE_CORE_CSS_CSSRULELIST_H_ - -#include "sky/engine/bindings/core/v8/ScriptWrappable.h" -#include "sky/engine/wtf/PassOwnPtr.h" -#include "sky/engine/wtf/PassRefPtr.h" -#include "sky/engine/wtf/RefPtr.h" -#include "sky/engine/wtf/Vector.h" - -namespace blink { - -class CSSRule; -class CSSStyleSheet; - -class CSSRuleList : public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); - WTF_MAKE_FAST_ALLOCATED; - WTF_MAKE_NONCOPYABLE(CSSRuleList); -public: - virtual ~CSSRuleList(); - -#if !ENABLE(OILPAN) - virtual void ref() = 0; - virtual void deref() = 0; -#endif - - virtual unsigned length() const = 0; - virtual CSSRule* item(unsigned index) const = 0; - - virtual CSSStyleSheet* styleSheet() const = 0; - -protected: - CSSRuleList(); -}; - -class StaticCSSRuleList final : public CSSRuleList { -public: - static PassRefPtr<StaticCSSRuleList> create() - { - return adoptRef(new StaticCSSRuleList()); - } - -#if !ENABLE(OILPAN) - virtual void ref() override { ++m_refCount; } - virtual void deref() override; -#endif - - Vector<RefPtr<CSSRule> >& rules() { return m_rules; } - - virtual CSSStyleSheet* styleSheet() const override { return 0; } - -private: - StaticCSSRuleList(); - virtual ~StaticCSSRuleList(); - - virtual unsigned length() const override { return m_rules.size(); } - virtual CSSRule* item(unsigned index) const override { return index < m_rules.size() ? m_rules[index].get() : 0; } - - Vector<RefPtr<CSSRule> > m_rules; -#if !ENABLE(OILPAN) - unsigned m_refCount; -#endif -}; - -template <class Rule> -class LiveCSSRuleList final : public CSSRuleList { -public: - static PassOwnPtr<LiveCSSRuleList> create(Rule* rule) - { - return adoptPtr(new LiveCSSRuleList(rule)); - } - -#if !ENABLE(OILPAN) - virtual void ref() override { m_rule->ref(); } - virtual void deref() override { m_rule->deref(); } -#endif - -private: - LiveCSSRuleList(Rule* rule) : m_rule(rule) { } - - virtual unsigned length() const override { return m_rule->length(); } - virtual CSSRule* item(unsigned index) const override { return m_rule->item(index); } - virtual CSSStyleSheet* styleSheet() const override { return m_rule->parentStyleSheet(); } - - RawPtr<Rule> m_rule; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSRULELIST_H_
diff --git a/sky/engine/core/css/CSSRuleList.idl b/sky/engine/core/css/CSSRuleList.idl deleted file mode 100644 index 28a2952..0000000 --- a/sky/engine/core/css/CSSRuleList.idl +++ /dev/null
@@ -1,33 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009 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 COMPUTER, 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 COMPUTER, 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. - */ - -// Introduced in DOM Level 2: -[ - DependentLifetime, -] interface CSSRuleList { - readonly attribute unsigned long length; - getter CSSRule item(unsigned long index); -}; -
diff --git a/sky/engine/core/css/CSSStyleDeclaration.h b/sky/engine/core/css/CSSStyleDeclaration.h index 93e3ff5..16b6211 100644 --- a/sky/engine/core/css/CSSStyleDeclaration.h +++ b/sky/engine/core/css/CSSStyleDeclaration.h
@@ -29,7 +29,6 @@ namespace blink { class CSSProperty; -class CSSRule; class CSSStyleSheet; class CSSValue; class ExceptionState; @@ -46,7 +45,6 @@ virtual void deref() = 0; #endif - virtual CSSRule* parentRule() const = 0; virtual String cssText() const = 0; virtual void setCSSText(const String&, ExceptionState&) = 0; virtual unsigned length() const = 0;
diff --git a/sky/engine/core/css/CSSStyleDeclaration.idl b/sky/engine/core/css/CSSStyleDeclaration.idl index c369167..6cfc092 100644 --- a/sky/engine/core/css/CSSStyleDeclaration.idl +++ b/sky/engine/core/css/CSSStyleDeclaration.idl
@@ -35,7 +35,6 @@ getter DOMString item([Default=Undefined] optional unsigned long index); [Custom=(PropertyGetter,PropertyEnumerator,PropertyQuery)] getter (DOMString or float) (DOMString name); [Custom] setter void (DOMString propertyName, DOMString? propertyValue); - readonly attribute CSSRule parentRule; // Deprecated as of 2003: http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html // FIXME: This should be DeprecateAs=, but currently too many tests use
diff --git a/sky/engine/core/css/CSSStyleRule.cpp b/sky/engine/core/css/CSSStyleRule.cpp deleted file mode 100644 index dc7a940..0000000 --- a/sky/engine/core/css/CSSStyleRule.cpp +++ /dev/null
@@ -1,133 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/css/CSSStyleRule.h" - -#include "sky/engine/core/css/CSSSelector.h" -#include "sky/engine/core/css/CSSStyleSheet.h" -#include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h" -#include "sky/engine/core/css/StylePropertySet.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/core/css/parser/BisonCSSParser.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -typedef HashMap<const CSSStyleRule*, String> SelectorTextCache; -static SelectorTextCache& selectorTextCache() -{ - DEFINE_STATIC_LOCAL(SelectorTextCache, cache, ()); - return cache; -} - -CSSStyleRule::CSSStyleRule(StyleRule* styleRule, CSSStyleSheet* parent) - : CSSRule(parent) - , m_styleRule(styleRule) -{ -} - -CSSStyleRule::~CSSStyleRule() -{ -#if !ENABLE(OILPAN) - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->clearParentRule(); -#endif - if (hasCachedSelectorText()) { - selectorTextCache().remove(this); - setHasCachedSelectorText(false); - } -} - -CSSStyleDeclaration* CSSStyleRule::style() const -{ - if (!m_propertiesCSSOMWrapper) { - m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleRule->mutableProperties(), const_cast<CSSStyleRule*>(this)); - } - return m_propertiesCSSOMWrapper.get(); -} - -String CSSStyleRule::generateSelectorText() const -{ - StringBuilder builder; - for (const CSSSelector* selector = m_styleRule->selectorList().first(); selector; selector = CSSSelectorList::next(*selector)) { - if (selector != m_styleRule->selectorList().first()) - builder.appendLiteral(", "); - builder.append(selector->selectorText()); - } - return builder.toString(); -} - -String CSSStyleRule::selectorText() const -{ - if (hasCachedSelectorText()) { - ASSERT(selectorTextCache().contains(this)); - return selectorTextCache().get(this); - } - - ASSERT(!selectorTextCache().contains(this)); - String text = generateSelectorText(); - selectorTextCache().set(this, text); - setHasCachedSelectorText(true); - return text; -} - -void CSSStyleRule::setSelectorText(const String& selectorText) -{ - CSSParserContext context(parserContext(), 0); - BisonCSSParser p(context); - CSSSelectorList selectorList; - p.parseSelector(selectorText, selectorList); - if (!selectorList.isValid()) - return; - - CSSStyleSheet::RuleMutationScope mutationScope(this); - - m_styleRule->wrapperAdoptSelectorList(selectorList); - - if (hasCachedSelectorText()) { - selectorTextCache().remove(this); - setHasCachedSelectorText(false); - } -} - -String CSSStyleRule::cssText() const -{ - StringBuilder result; - result.append(selectorText()); - result.appendLiteral(" { "); - String decls = m_styleRule->properties().asText(); - result.append(decls); - if (!decls.isEmpty()) - result.append(' '); - result.append('}'); - return result.toString(); -} - -void CSSStyleRule::reattach(StyleRuleBase* rule) -{ - ASSERT(rule); - m_styleRule = toStyleRule(rule); - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties()); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSStyleRule.h b/sky/engine/core/css/CSSStyleRule.h deleted file mode 100644 index 16ad36b..0000000 --- a/sky/engine/core/css/CSSStyleRule.h +++ /dev/null
@@ -1,68 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSSTYLERULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSSTYLERULE_H_ - -#include "sky/engine/core/css/CSSRule.h" -#include "sky/engine/platform/heap/Handle.h" - -namespace blink { - -class CSSStyleDeclaration; -class StyleRuleCSSStyleDeclaration; -class StyleRule; - -class CSSStyleRule final : public CSSRule { -public: - static PassRefPtr<CSSStyleRule> create(StyleRule* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSStyleRule(rule, sheet)); - } - - virtual ~CSSStyleRule(); - - virtual CSSRule::Type type() const override { return STYLE_RULE; } - virtual String cssText() const override; - virtual void reattach(StyleRuleBase*) override; - - String selectorText() const; - void setSelectorText(const String&); - - CSSStyleDeclaration* style() const; - - // FIXME: Not CSSOM. Remove. - StyleRule* styleRule() const { return m_styleRule.get(); } - -private: - CSSStyleRule(StyleRule*, CSSStyleSheet*); - - String generateSelectorText() const; - - RefPtr<StyleRule> m_styleRule; - mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, STYLE_RULE); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSSTYLERULE_H_
diff --git a/sky/engine/core/css/CSSStyleRule.idl b/sky/engine/core/css/CSSStyleRule.idl deleted file mode 100644 index b5c890f..0000000 --- a/sky/engine/core/css/CSSStyleRule.idl +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface CSSStyleRule : CSSRule { - attribute DOMString selectorText; - readonly attribute CSSStyleDeclaration style; -};
diff --git a/sky/engine/core/css/CSSStyleSheet.cpp b/sky/engine/core/css/CSSStyleSheet.cpp index 376aff1..62dc97e 100644 --- a/sky/engine/core/css/CSSStyleSheet.cpp +++ b/sky/engine/core/css/CSSStyleSheet.cpp
@@ -24,7 +24,6 @@ #include "sky/engine/bindings/core/v8/ExceptionState.h" #include "sky/engine/bindings/core/v8/V8Binding.h" #include "sky/engine/bindings/core/v8/V8PerIsolateData.h" -#include "sky/engine/core/css/CSSRuleList.h" #include "sky/engine/core/css/MediaList.h" #include "sky/engine/core/css/StyleRule.h" #include "sky/engine/core/css/StyleSheetContents.h" @@ -38,27 +37,6 @@ namespace blink { -class StyleSheetCSSRuleList final : public CSSRuleList { -public: - static PassOwnPtr<StyleSheetCSSRuleList> create(CSSStyleSheet* sheet) - { - return adoptPtr(new StyleSheetCSSRuleList(sheet)); - } - -private: - StyleSheetCSSRuleList(CSSStyleSheet* sheet) : m_styleSheet(sheet) { } - - virtual void ref() override { m_styleSheet->ref(); } - virtual void deref() override { m_styleSheet->deref(); } - - virtual unsigned length() const override { return m_styleSheet->length(); } - virtual CSSRule* item(unsigned index) const override { return m_styleSheet->item(index); } - - virtual CSSStyleSheet* styleSheet() const override { return m_styleSheet; } - - RawPtr<CSSStyleSheet> m_styleSheet; -}; - #if ENABLE(ASSERT) static bool isAcceptableCSSStyleSheetParent(Node* parentNode) { @@ -107,21 +85,6 @@ CSSStyleSheet::~CSSStyleSheet() { - // With oilpan the parent style sheet pointer is strong and the sheet and - // its RuleCSSOMWrappers die together and we don't need to clear them here. - // Also with oilpan the StyleSheetContents client pointers are weak and - // therefore do not need to be cleared here. - // For style rules outside the document, .parentStyleSheet can become null even if the style rule - // is still observable from JavaScript. This matches the behavior of .parentNode for nodes, but - // it's not ideal because it makes the CSSOM's behavior depend on the timing of garbage collection. - for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { - if (m_childRuleCSSOMWrappers[i]) - m_childRuleCSSOMWrappers[i]->setParentStyleSheet(0); - } - - if (m_mediaCSSOMWrapper) - m_mediaCSSOMWrapper->clearParentStyleSheet(); - m_contents->unregisterClient(this); } @@ -144,9 +107,6 @@ m_contents->registerClient(this); m_contents->setMutable(); - - // Any existing CSSOM wrappers need to be connected to the copied child rules. - reattachChildRuleCSSOMWrappers(); } void CSSStyleSheet::didMutateRules() @@ -166,20 +126,10 @@ owner->modifiedStyleSheet(this); } -void CSSStyleSheet::reattachChildRuleCSSOMWrappers() -{ - for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { - if (!m_childRuleCSSOMWrappers[i]) - continue; - m_childRuleCSSOMWrappers[i]->reattach(m_contents->ruleAt(i)); - } -} void CSSStyleSheet::setMediaQueries(PassRefPtr<MediaQuerySet> mediaQueries) { m_mediaQueries = mediaQueries; - if (m_mediaCSSOMWrapper && m_mediaQueries) - m_mediaCSSOMWrapper->reattach(m_mediaQueries.get()); // Add warning message to inspector whenever dpi/dpcm values are used for "screen" media. reportMediaQueryWarningIfNeeded(ownerDocument(), m_mediaQueries.get()); @@ -190,22 +140,6 @@ return m_contents->ruleCount(); } -CSSRule* CSSStyleSheet::item(unsigned index) -{ - unsigned ruleCount = length(); - if (index >= ruleCount) - return 0; - - if (m_childRuleCSSOMWrappers.isEmpty()) - m_childRuleCSSOMWrappers.grow(ruleCount); - ASSERT(m_childRuleCSSOMWrappers.size() == ruleCount); - - RefPtr<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index]; - if (!cssRule) - cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this); - return cssRule.get(); -} - void CSSStyleSheet::clearOwnerNode() { didMutate(EntireStyleSheetUpdate); @@ -214,123 +148,14 @@ m_ownerNode = nullptr; } -PassRefPtr<CSSRuleList> CSSStyleSheet::rules() -{ - // IE behavior. - RefPtr<StaticCSSRuleList> nonCharsetRules(StaticCSSRuleList::create()); - unsigned ruleCount = length(); - for (unsigned i = 0; i < ruleCount; ++i) { - CSSRule* rule = item(i); - nonCharsetRules->rules().append(rule); - } - return nonCharsetRules.release(); -} - -unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, ExceptionState& exceptionState) -{ - ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size() == m_contents->ruleCount()); - - if (index > length()) { - exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is larger than the maximum index (" + String::number(length()) + ")."); - return 0; - } - CSSParserContext context(m_contents->parserContext(), UseCounter::getFrom(this)); - BisonCSSParser p(context); - RefPtr<StyleRuleBase> rule = p.parseRule(m_contents.get(), ruleString); - - if (!rule) { - exceptionState.throwDOMException(SyntaxError, "Failed to parse the rule '" + ruleString + "'."); - return 0; - } - RuleMutationScope mutationScope(this); - - bool success = m_contents->wrapperInsertRule(rule, index); - if (!success) { - exceptionState.throwDOMException(HierarchyRequestError, "Failed to insert the rule."); - return 0; - } - if (!m_childRuleCSSOMWrappers.isEmpty()) - m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>(nullptr)); - - return index; -} - -unsigned CSSStyleSheet::insertRule(const String& rule, ExceptionState& exceptionState) -{ - UseCounter::countDeprecation(callingExecutionContext(V8PerIsolateData::mainThreadIsolate()), UseCounter::CSSStyleSheetInsertRuleOptionalArg); - return insertRule(rule, 0, exceptionState); -} - -void CSSStyleSheet::deleteRule(unsigned index, ExceptionState& exceptionState) -{ - ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size() == m_contents->ruleCount()); - - if (index >= length()) { - exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is larger than the maximum index (" + String::number(length() - 1) + ")."); - return; - } - RuleMutationScope mutationScope(this); - - m_contents->wrapperDeleteRule(index); - - if (!m_childRuleCSSOMWrappers.isEmpty()) { - if (m_childRuleCSSOMWrappers[index]) - m_childRuleCSSOMWrappers[index]->setParentStyleSheet(0); - m_childRuleCSSOMWrappers.remove(index); - } -} - -int CSSStyleSheet::addRule(const String& selector, const String& style, int index, ExceptionState& exceptionState) -{ - StringBuilder text; - text.append(selector); - text.appendLiteral(" { "); - text.append(style); - if (!style.isEmpty()) - text.append(' '); - text.append('}'); - insertRule(text.toString(), index, exceptionState); - - // As per Microsoft documentation, always return -1. - return -1; -} - -int CSSStyleSheet::addRule(const String& selector, const String& style, ExceptionState& exceptionState) -{ - return addRule(selector, style, length(), exceptionState); -} - - -PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules() -{ - if (!m_ruleListCSSOMWrapper) - m_ruleListCSSOMWrapper = StyleSheetCSSRuleList::create(this); - return m_ruleListCSSOMWrapper.get(); -} - KURL CSSStyleSheet::baseURL() const { return m_contents->baseURL(); } -MediaList* CSSStyleSheet::media() const -{ - if (!m_mediaQueries) - return 0; - - if (!m_mediaCSSOMWrapper) - m_mediaCSSOMWrapper = MediaList::create(m_mediaQueries.get(), const_cast<CSSStyleSheet*>(this)); - return m_mediaCSSOMWrapper.get(); -} - Document* CSSStyleSheet::ownerDocument() const { return ownerNode() ? &ownerNode()->document() : 0; } -void CSSStyleSheet::clearChildRuleCSSOMWrappers() -{ - m_childRuleCSSOMWrappers.clear(); -} - } // namespace blink
diff --git a/sky/engine/core/css/CSSStyleSheet.h b/sky/engine/core/css/CSSStyleSheet.h index f1ea840..7511226 100644 --- a/sky/engine/core/css/CSSStyleSheet.h +++ b/sky/engine/core/css/CSSStyleSheet.h
@@ -21,7 +21,6 @@ #ifndef SKY_ENGINE_CORE_CSS_CSSSTYLESHEET_H_ #define SKY_ENGINE_CORE_CSS_CSSSTYLESHEET_H_ -#include "sky/engine/core/css/CSSRule.h" #include "sky/engine/core/css/StyleSheet.h" #include "sky/engine/platform/heap/Handle.h" #include "sky/engine/wtf/Noncopyable.h" @@ -30,8 +29,6 @@ namespace blink { class BisonCSSParser; -class CSSRule; -class CSSRuleList; class CSSStyleSheet; class Document; class ExceptionState; @@ -44,7 +41,6 @@ }; class CSSStyleSheet final : public StyleSheet { - DEFINE_WRAPPERTYPEINFO(); public: static PassRefPtr<CSSStyleSheet> createInline(Node*, const KURL&, const TextPosition& startPosition = TextPosition::minimumPosition()); static PassRefPtr<CSSStyleSheet> createInline(PassRefPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = TextPosition::minimumPosition()); @@ -52,22 +48,8 @@ virtual ~CSSStyleSheet(); virtual Node* ownerNode() const override { return m_ownerNode; } - virtual MediaList* media() const override; - PassRefPtr<CSSRuleList> cssRules(); - unsigned insertRule(const String& rule, unsigned index, ExceptionState&); - unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. - void deleteRule(unsigned index, ExceptionState&); - - // IE Extensions - PassRefPtr<CSSRuleList> rules(); - int addRule(const String& selector, const String& style, int index, ExceptionState&); - int addRule(const String& selector, const String& style, ExceptionState&); - void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule(index, exceptionState); } - - // For CSSRuleList. unsigned length() const; - CSSRule* item(unsigned index); virtual void clearOwnerNode() override; @@ -82,7 +64,6 @@ STACK_ALLOCATED(); public: explicit RuleMutationScope(CSSStyleSheet*); - explicit RuleMutationScope(CSSRule*); ~RuleMutationScope(); private: @@ -93,8 +74,6 @@ void didMutateRules(); void didMutate(StyleSheetUpdateType = PartialRuleUpdate); - void clearChildRuleCSSOMWrappers(); - StyleSheetContents* contents() const { return m_contents.get(); } bool isInline() const { return m_isInlineStylesheet; } @@ -107,8 +86,6 @@ virtual bool isCSSStyleSheet() const override { return true; } virtual String type() const override { return "text/css"; } - void reattachChildRuleCSSOMWrappers(); - RefPtr<StyleSheetContents> m_contents; bool m_isInlineStylesheet; RefPtr<MediaQuerySet> m_mediaQueries; @@ -116,9 +93,6 @@ RawPtr<Node> m_ownerNode; TextPosition m_startPosition; - mutable RefPtr<MediaList> m_mediaCSSOMWrapper; - mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; - mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; }; inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSStyleSheet* sheet) @@ -128,13 +102,6 @@ m_styleSheet->willMutateRules(); } -inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSRule* rule) - : m_styleSheet(rule ? rule->parentStyleSheet() : 0) -{ - if (m_styleSheet) - m_styleSheet->willMutateRules(); -} - inline CSSStyleSheet::RuleMutationScope::~RuleMutationScope() { if (m_styleSheet)
diff --git a/sky/engine/core/css/CSSStyleSheet.idl b/sky/engine/core/css/CSSStyleSheet.idl deleted file mode 100644 index 6d9de96..0000000 --- a/sky/engine/core/css/CSSStyleSheet.idl +++ /dev/null
@@ -1,37 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - SetWrapperReferenceFrom=ownerNode, -] interface CSSStyleSheet : StyleSheet { - readonly attribute CSSRuleList cssRules; - - [RaisesException] unsigned long insertRule(DOMString rule, optional unsigned long index); - [RaisesException] void deleteRule(unsigned long index); - - // IE Extensions - [MeasureAs=CSSStyleSheetRules] readonly attribute CSSRuleList rules; - - [RaisesException, MeasureAs=CSSStyleSheetAddRule] long addRule([Default=Undefined] optional DOMString selector, - [Default=Undefined] optional DOMString style, - optional unsigned long index); - [RaisesException, MeasureAs=CSSStyleSheetRemoveRule] void removeRule([Default=Undefined] optional unsigned long index); -};
diff --git a/sky/engine/core/css/CSSSupportsRule.cpp b/sky/engine/core/css/CSSSupportsRule.cpp deleted file mode 100644 index 867f3a7..0000000 --- a/sky/engine/core/css/CSSSupportsRule.cpp +++ /dev/null
@@ -1,61 +0,0 @@ -/* Copyright (C) 2012 Motorola Mobility 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. - * 3. Neither the name of Motorola Mobility Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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 "sky/engine/config.h" -#include "sky/engine/core/css/CSSSupportsRule.h" - -#include "sky/engine/core/css/CSSRule.h" -#include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -CSSSupportsRule::CSSSupportsRule(StyleRuleSupports* supportsRule, CSSStyleSheet* parent) - : CSSGroupingRule(supportsRule, parent) -{ -} - -String CSSSupportsRule::cssText() const -{ - StringBuilder result; - - result.appendLiteral("@supports "); - result.append(conditionText()); - result.appendLiteral(" {\n"); - appendCSSTextForItems(result); - result.append('}'); - - return result.toString(); -} - -String CSSSupportsRule::conditionText() const -{ - return toStyleRuleSupports(m_groupRule.get())->conditionText(); -} - -} // namespace blink
diff --git a/sky/engine/core/css/CSSSupportsRule.h b/sky/engine/core/css/CSSSupportsRule.h deleted file mode 100644 index cd2955e..0000000 --- a/sky/engine/core/css/CSSSupportsRule.h +++ /dev/null
@@ -1,61 +0,0 @@ -/* Copyright (C) 2012 Motorola Mobility 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. - * 3. Neither the name of Motorola Mobility Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSSUPPORTSRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSSUPPORTSRULE_H_ - -#include "sky/engine/core/css/CSSGroupingRule.h" - -namespace blink { - -class CSSRule; -class StyleRuleSupports; - -class CSSSupportsRule final : public CSSGroupingRule { -public: - static PassRefPtr<CSSSupportsRule> create(StyleRuleSupports* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSSupportsRule(rule, sheet)); - } - - virtual ~CSSSupportsRule() { } - - virtual CSSRule::Type type() const override { return SUPPORTS_RULE; } - virtual String cssText() const override; - - String conditionText() const; - -private: - CSSSupportsRule(StyleRuleSupports*, CSSStyleSheet*); -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSSupportsRule, SUPPORTS_RULE); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSSUPPORTSRULE_H_
diff --git a/sky/engine/core/css/CSSSupportsRule.idl b/sky/engine/core/css/CSSSupportsRule.idl deleted file mode 100644 index b2aa0cc..0000000 --- a/sky/engine/core/css/CSSSupportsRule.idl +++ /dev/null
@@ -1,38 +0,0 @@ -/* Copyright (C) 2012 Motorola Mobility 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. - * 3. Neither the name of Motorola Mobility Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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. - */ - -[ - NoInterfaceObject -] interface CSSSupportsRule : CSSRule { - readonly attribute CSSRuleList cssRules; - readonly attribute DOMString conditionText; - - [RaisesException] unsigned long insertRule([Default=Undefined] optional DOMString rule, - [Default=Undefined] optional unsigned long index); - [RaisesException] void deleteRule([Default=Undefined] optional unsigned long index); -};
diff --git a/sky/engine/core/css/CSSTestHelper.cpp b/sky/engine/core/css/CSSTestHelper.cpp index 7c998f3..07f2dd2 100644 --- a/sky/engine/core/css/CSSTestHelper.cpp +++ b/sky/engine/core/css/CSSTestHelper.cpp
@@ -30,7 +30,6 @@ #include "sky/engine/config.h" #include "sky/engine/core/css/CSSTestHelper.h" -#include "sky/engine/core/css/CSSRuleList.h" #include "sky/engine/core/css/CSSStyleSheet.h" #include "sky/engine/core/css/RuleSet.h" #include "sky/engine/core/css/StyleSheetContents.h"
diff --git a/sky/engine/core/css/CSSUnknownRule.h b/sky/engine/core/css/CSSUnknownRule.h deleted file mode 100644 index 14e57ea..0000000 --- a/sky/engine/core/css/CSSUnknownRule.h +++ /dev/null
@@ -1,41 +0,0 @@ -/* - * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_CSS_CSSUNKNOWNRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSUNKNOWNRULE_H_ - -#include "sky/engine/core/css/CSSRule.h" - -namespace blink { - -class CSSUnknownRule final : public CSSRule { -public: - CSSUnknownRule() : CSSRule(0) { } - virtual ~CSSUnknownRule() { } - - virtual CSSRule::Type type() const override { return UNKNOWN_RULE; } - virtual String cssText() const override { return String(); } - virtual void reattach(StyleRuleBase*) override { } -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_CSS_CSSUNKNOWNRULE_H_
diff --git a/sky/engine/core/css/CSSUnknownRule.idl b/sky/engine/core/css/CSSUnknownRule.idl deleted file mode 100644 index c06bfed..0000000 --- a/sky/engine/core/css/CSSUnknownRule.idl +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ -] interface CSSUnknownRule : CSSRule { -}; -
diff --git a/sky/engine/core/css/ElementRuleCollector.cpp b/sky/engine/core/css/ElementRuleCollector.cpp index efa7ca7..f4ad0a2 100644 --- a/sky/engine/core/css/ElementRuleCollector.cpp +++ b/sky/engine/core/css/ElementRuleCollector.cpp
@@ -29,13 +29,8 @@ #include "sky/engine/config.h" #include "sky/engine/core/css/ElementRuleCollector.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" -#include "sky/engine/core/css/CSSMediaRule.h" -#include "sky/engine/core/css/CSSRuleList.h" #include "sky/engine/core/css/CSSSelector.h" -#include "sky/engine/core/css/CSSStyleRule.h" #include "sky/engine/core/css/CSSStyleSheet.h" -#include "sky/engine/core/css/CSSSupportsRule.h" #include "sky/engine/core/css/StylePropertySet.h" #include "sky/engine/core/css/resolver/StyleResolver.h" #include "sky/engine/core/dom/shadow/ShadowRoot.h"
diff --git a/sky/engine/core/css/ElementRuleCollector.h b/sky/engine/core/css/ElementRuleCollector.h index dca6847..232d4a0 100644 --- a/sky/engine/core/css/ElementRuleCollector.h +++ b/sky/engine/core/css/ElementRuleCollector.h
@@ -32,11 +32,9 @@ namespace blink { class CSSStyleSheet; -class CSSRuleList; class RuleData; class RuleSet; class ScopedStyleResolver; -class StaticCSSRuleList; typedef unsigned CascadeScope; typedef unsigned CascadeOrder;
diff --git a/sky/engine/core/css/MediaList.cpp b/sky/engine/core/css/MediaList.cpp index e42a2d9..8d15ec8 100644 --- a/sky/engine/core/css/MediaList.cpp +++ b/sky/engine/core/css/MediaList.cpp
@@ -172,14 +172,6 @@ MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) : m_mediaQueries(mediaQueries) , m_parentStyleSheet(parentSheet) - , m_parentRule(nullptr) -{ -} - -MediaList::MediaList(MediaQuerySet* mediaQueries, CSSRule* parentRule) - : m_mediaQueries(mediaQueries) - , m_parentStyleSheet(nullptr) - , m_parentRule(parentRule) { } @@ -187,57 +179,6 @@ { } -void MediaList::setMediaText(const String& value) -{ - CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); - - m_mediaQueries->set(value); - - if (m_parentStyleSheet) - m_parentStyleSheet->didMutate(); -} - -String MediaList::item(unsigned index) const -{ - const Vector<OwnPtr<MediaQuery> >& queries = m_mediaQueries->queryVector(); - if (index < queries.size()) - return queries[index]->cssText(); - return String(); -} - -void MediaList::deleteMedium(const String& medium, ExceptionState& exceptionState) -{ - CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); - - bool success = m_mediaQueries->remove(medium); - if (!success) { - exceptionState.throwDOMException(NotFoundError, "Failed to delete '" + medium + "'."); - return; - } - if (m_parentStyleSheet) - m_parentStyleSheet->didMutate(); -} - -void MediaList::appendMedium(const String& medium, ExceptionState& exceptionState) -{ - CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); - - bool success = m_mediaQueries->add(medium); - if (!success) { - exceptionState.throwDOMException(InvalidCharacterError, "The value provided ('" + medium + "') is not a valid medium."); - return; - } - - if (m_parentStyleSheet) - m_parentStyleSheet->didMutate(); -} - -void MediaList::reattach(MediaQuerySet* mediaQueries) -{ - ASSERT(mediaQueries); - m_mediaQueries = mediaQueries; -} - static void addResolutionWarningMessageToConsole(Document* document, const String& serializedExpression, CSSPrimitiveValue::UnitType type) { ASSERT(document);
diff --git a/sky/engine/core/css/MediaList.h b/sky/engine/core/css/MediaList.h index 63f20dd..1981783 100644 --- a/sky/engine/core/css/MediaList.h +++ b/sky/engine/core/css/MediaList.h
@@ -21,7 +21,6 @@ #ifndef SKY_ENGINE_CORE_CSS_MEDIALIST_H_ #define SKY_ENGINE_CORE_CSS_MEDIALIST_H_ -#include "sky/engine/bindings/core/v8/ScriptWrappable.h" #include "sky/engine/core/dom/ExceptionCode.h" #include "sky/engine/platform/heap/Handle.h" #include "sky/engine/wtf/Forward.h" @@ -32,7 +31,6 @@ namespace blink { -class CSSRule; class CSSStyleSheet; class Document; class ExceptionState; @@ -68,50 +66,34 @@ Vector<OwnPtr<MediaQuery> > m_queries; }; -class MediaList : public RefCounted<MediaList>, public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); +class MediaList : public RefCounted<MediaList> { public: static PassRefPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) { return adoptRef(new MediaList(mediaQueries, parentSheet)); } - static PassRefPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSRule* parentRule) - { - return adoptRef(new MediaList(mediaQueries, parentRule)); - } ~MediaList(); unsigned length() const { return m_mediaQueries->queryVector().size(); } - String item(unsigned index) const; - void deleteMedium(const String& oldMedium, ExceptionState&); - void appendMedium(const String& newMedium, ExceptionState&); String mediaText() const { return m_mediaQueries->mediaText(); } - void setMediaText(const String&); // Not part of CSSOM. - CSSRule* parentRule() const { return m_parentRule; } CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; } #if !ENABLE(OILPAN) void clearParentStyleSheet() { ASSERT(m_parentStyleSheet); m_parentStyleSheet = nullptr; } - void clearParentRule() { ASSERT(m_parentRule); m_parentRule = nullptr; } #endif const MediaQuerySet* queries() const { return m_mediaQueries.get(); } - void reattach(MediaQuerySet*); - private: MediaList(MediaQuerySet*, CSSStyleSheet* parentSheet); - MediaList(MediaQuerySet*, CSSRule* parentRule); RefPtr<MediaQuerySet> m_mediaQueries; // Cleared in ~CSSStyleSheet destructor when oilpan is not enabled. RawPtr<CSSStyleSheet> m_parentStyleSheet; - // Cleared in the ~CSSMediaRule destructors when oilpan is not enabled. - RawPtr<CSSRule> m_parentRule; }; // Adds message to inspector console whenever dpi or dpcm values are used for "screen" media.
diff --git a/sky/engine/core/css/MediaList.idl b/sky/engine/core/css/MediaList.idl deleted file mode 100644 index 5c52c76..0000000 --- a/sky/engine/core/css/MediaList.idl +++ /dev/null
@@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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 COMPUTER, 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 COMPUTER, 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. - */ - -// Introduced in DOM Level 2: -[ -] interface MediaList { - - attribute DOMString? mediaText; - readonly attribute unsigned long length; - - [TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index); - [RaisesException] void deleteMedium(DOMString oldMedium); - [RaisesException] void appendMedium(DOMString newMedium); - -}; -
diff --git a/sky/engine/core/css/PropertySetCSSStyleDeclaration.cpp b/sky/engine/core/css/PropertySetCSSStyleDeclaration.cpp index a6e6dfa..503a0e4 100644 --- a/sky/engine/core/css/PropertySetCSSStyleDeclaration.cpp +++ b/sky/engine/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -280,71 +280,6 @@ return propertySet().propertyMatches(propertyID, propertyValue); } -StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet& propertySetArg, CSSRule* parentRule) - : PropertySetCSSStyleDeclaration(propertySetArg) -#if !ENABLE(OILPAN) - , m_refCount(1) -#endif - , m_parentRule(parentRule) -{ -#if !ENABLE(OILPAN) - m_propertySet->ref(); -#endif -} - -StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration() -{ -#if !ENABLE(OILPAN) - m_propertySet->deref(); -#endif -} - -#if !ENABLE(OILPAN) -void StyleRuleCSSStyleDeclaration::ref() -{ - ++m_refCount; -} - -void StyleRuleCSSStyleDeclaration::deref() -{ - ASSERT(m_refCount); - if (!--m_refCount) - delete this; -} -#endif - -void StyleRuleCSSStyleDeclaration::willMutate() -{ - if (m_parentRule && m_parentRule->parentStyleSheet()) - m_parentRule->parentStyleSheet()->willMutateRules(); -} - -void StyleRuleCSSStyleDeclaration::didMutate(MutationType type) -{ - if (type == PropertyChanged) - m_cssomCSSValueClones.clear(); - - // Style sheet mutation needs to be signaled even if the change failed. willMutateRules/didMutateRules must pair. - if (m_parentRule && m_parentRule->parentStyleSheet()) - m_parentRule->parentStyleSheet()->didMutateRules(); -} - -CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const -{ - return m_parentRule ? m_parentRule->parentStyleSheet() : 0; -} - -void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet) -{ -#if !ENABLE(OILPAN) - m_propertySet->deref(); -#endif - m_propertySet = &propertySet; -#if !ENABLE(OILPAN) - m_propertySet->ref(); -#endif -} - MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const { return m_parentElement->ensureMutableInlineStyle();
diff --git a/sky/engine/core/css/PropertySetCSSStyleDeclaration.h b/sky/engine/core/css/PropertySetCSSStyleDeclaration.h index 7e802ae..75d6c4e 100644 --- a/sky/engine/core/css/PropertySetCSSStyleDeclaration.h +++ b/sky/engine/core/css/PropertySetCSSStyleDeclaration.h
@@ -33,7 +33,6 @@ namespace blink { class CSSProperty; -class CSSRule; class CSSValue; class Element; class ExceptionState; @@ -46,7 +45,6 @@ StyleSheetContents* contextStyleSheet() const; private: - virtual CSSRule* parentRule() const override { return 0; } virtual unsigned length() const override final; virtual String item(unsigned index) const override final; virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) override final; @@ -91,40 +89,6 @@ RawPtr<MutableStylePropertySet> m_propertySet; // Cannot be null }; -class StyleRuleCSSStyleDeclaration final : public PropertySetCSSStyleDeclaration -{ -public: - static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule) - { - return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule)); - } - -#if !ENABLE(OILPAN) - void clearParentRule() { m_parentRule = nullptr; } - - virtual void ref() override; - virtual void deref() override; -#endif - - void reattach(MutableStylePropertySet&); - -private: - StyleRuleCSSStyleDeclaration(MutableStylePropertySet&, CSSRule*); - virtual ~StyleRuleCSSStyleDeclaration(); - - virtual CSSStyleSheet* parentStyleSheet() const override; - - virtual CSSRule* parentRule() const override { return m_parentRule; } - - virtual void willMutate() override; - virtual void didMutate(MutationType) override; - -#if !ENABLE(OILPAN) - unsigned m_refCount; -#endif - RawPtr<CSSRule> m_parentRule; -}; - class InlineCSSStyleDeclaration final : public AbstractPropertySetCSSStyleDeclaration { public:
diff --git a/sky/engine/core/css/RuleSet.cpp b/sky/engine/core/css/RuleSet.cpp index acadb1e..a01f059 100644 --- a/sky/engine/core/css/RuleSet.cpp +++ b/sky/engine/core/css/RuleSet.cpp
@@ -34,9 +34,9 @@ #include "sky/engine/core/css/CSSSelector.h" #include "sky/engine/core/css/CSSSelectorList.h" #include "sky/engine/core/css/SelectorChecker.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" #include "sky/engine/core/css/StyleSheetContents.h" #include "sky/engine/platform/TraceEvent.h" - #include "sky/engine/wtf/TerminatedArrayBuilder.h" namespace blink {
diff --git a/sky/engine/core/css/RuleSet.h b/sky/engine/core/css/RuleSet.h index 232f214..c4fae3c 100644 --- a/sky/engine/core/css/RuleSet.h +++ b/sky/engine/core/css/RuleSet.h
@@ -22,10 +22,10 @@ #ifndef SKY_ENGINE_CORE_CSS_RULESET_H_ #define SKY_ENGINE_CORE_CSS_RULESET_H_ -#include "sky/engine/core/css/CSSKeyframesRule.h" #include "sky/engine/core/css/MediaQueryEvaluator.h" #include "sky/engine/core/css/RuleFeature.h" #include "sky/engine/core/css/StyleRule.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" #include "sky/engine/core/css/resolver/MediaQueryResult.h" #include "sky/engine/wtf/Forward.h" #include "sky/engine/wtf/HashMap.h"
diff --git a/sky/engine/core/css/CSSKeyframeRule.cpp b/sky/engine/core/css/StyleKeyframe.cpp similarity index 82% rename from sky/engine/core/css/CSSKeyframeRule.cpp rename to sky/engine/core/css/StyleKeyframe.cpp index 4e4694d..78d2cfb 100644 --- a/sky/engine/core/css/CSSKeyframeRule.cpp +++ b/sky/engine/core/css/StyleKeyframe.cpp
@@ -24,13 +24,10 @@ */ #include "sky/engine/config.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" +#include "sky/engine/core/css/StyleKeyframe.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" -#include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h" #include "sky/engine/core/css/StylePropertySet.h" #include "sky/engine/core/css/parser/BisonCSSParser.h" -#include "sky/engine/core/frame/UseCounter.h" #include "sky/engine/wtf/text/StringBuilder.h" namespace blink { @@ -136,32 +133,4 @@ return keyVector.release(); } -CSSKeyframeRule::CSSKeyframeRule(StyleKeyframe* keyframe, CSSKeyframesRule* parent) - : CSSRule(0) - , m_keyframe(keyframe) -{ - setParentRule(parent); -} - -CSSKeyframeRule::~CSSKeyframeRule() -{ -#if !ENABLE(OILPAN) - if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->clearParentRule(); -#endif -} - -CSSStyleDeclaration* CSSKeyframeRule::style() const -{ - if (!m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyframe->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); - return m_propertiesCSSOMWrapper.get(); -} - -void CSSKeyframeRule::reattach(StyleRuleBase*) -{ - // No need to reattach, the underlying data is shareable on mutation. - ASSERT_NOT_REACHED(); -} - } // namespace blink
diff --git a/sky/engine/core/css/CSSKeyframeRule.h b/sky/engine/core/css/StyleKeyframe.h similarity index 71% rename from sky/engine/core/css/CSSKeyframeRule.h rename to sky/engine/core/css/StyleKeyframe.h index 19c192c..7d6dc01 100644 --- a/sky/engine/core/css/CSSKeyframeRule.h +++ b/sky/engine/core/css/StyleKeyframe.h
@@ -23,19 +23,21 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SKY_ENGINE_CORE_CSS_CSSKEYFRAMERULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSKEYFRAMERULE_H_ +#ifndef SKY_ENGINE_CORE_CSS_STYLEKEYFRAME_H_ +#define SKY_ENGINE_CORE_CSS_STYLEKEYFRAME_H_ -#include "sky/engine/core/css/CSSRule.h" +#include "sky/engine/wtf/Forward.h" +#include "sky/engine/wtf/OwnPtr.h" +#include "sky/engine/wtf/RefCounted.h" +#include "sky/engine/wtf/Vector.h" +#include "sky/engine/wtf/text/WTFString.h" namespace blink { class CSSKeyframesRule; class CSSParserValueList; -class CSSStyleDeclaration; class MutableStylePropertySet; class StylePropertySet; -class StyleRuleCSSStyleDeclaration; class StyleKeyframe final : public RefCounted<StyleKeyframe> { WTF_MAKE_FAST_ALLOCATED; @@ -72,30 +74,6 @@ mutable OwnPtr<Vector<double> > m_keys; }; -class CSSKeyframeRule final : public CSSRule { -public: - virtual ~CSSKeyframeRule(); - - virtual CSSRule::Type type() const override { return KEYFRAME_RULE; } - virtual String cssText() const override { return m_keyframe->cssText(); } - virtual void reattach(StyleRuleBase*) override; - - String keyText() const { return m_keyframe->keyText(); } - void setKeyText(const String& s) { m_keyframe->setKeyText(s); } - - CSSStyleDeclaration* style() const; - -private: - CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent); - - RefPtr<StyleKeyframe> m_keyframe; - mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; - - friend class CSSKeyframesRule; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE); - } // namespace blink -#endif // SKY_ENGINE_CORE_CSS_CSSKEYFRAMERULE_H_ +#endif // SKY_ENGINE_CORE_CSS_STYLEKEYFRAME_H_
diff --git a/sky/engine/core/css/StylePropertySet.cpp b/sky/engine/core/css/StylePropertySet.cpp index e13059b..66803bb 100644 --- a/sky/engine/core/css/StylePropertySet.cpp +++ b/sky/engine/core/css/StylePropertySet.cpp
@@ -498,7 +498,6 @@ // FIXME: get rid of this weirdness of a CSSStyleDeclaration inside of a // style property set. if (m_cssomWrapper) { - ASSERT(!static_cast<CSSStyleDeclaration*>(m_cssomWrapper.get())->parentRule()); ASSERT(!m_cssomWrapper->parentElement()); return m_cssomWrapper.get(); }
diff --git a/sky/engine/core/css/StylePropertySet.h b/sky/engine/core/css/StylePropertySet.h index 497fb3d..02c295a 100644 --- a/sky/engine/core/css/StylePropertySet.h +++ b/sky/engine/core/css/StylePropertySet.h
@@ -32,7 +32,6 @@ namespace blink { -class CSSRule; class CSSStyleDeclaration; class Element; class ImmutableStylePropertySet;
diff --git a/sky/engine/core/css/StyleRule.cpp b/sky/engine/core/css/StyleRule.cpp index b200e3f..74b3ca5 100644 --- a/sky/engine/core/css/StyleRule.cpp +++ b/sky/engine/core/css/StyleRule.cpp
@@ -22,13 +22,8 @@ #include "sky/engine/config.h" #include "sky/engine/core/css/StyleRule.h" -#include "sky/engine/core/css/CSSFilterRule.h" -#include "sky/engine/core/css/CSSFontFaceRule.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" -#include "sky/engine/core/css/CSSMediaRule.h" -#include "sky/engine/core/css/CSSStyleRule.h" -#include "sky/engine/core/css/CSSSupportsRule.h" #include "sky/engine/core/css/StylePropertySet.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" namespace blink { @@ -38,16 +33,6 @@ COMPILE_ASSERT(sizeof(StyleRuleBase) <= sizeof(SameSizeAsStyleRuleBase), StyleRuleBase_should_stay_small); -PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const -{ - return createCSSOMWrapper(parentSheet, 0); -} - -PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const -{ - return createCSSOMWrapper(0, parentRule); -} - void StyleRuleBase::destroy() { switch (type()) { @@ -101,39 +86,6 @@ return nullptr; } -PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const -{ - RefPtr<CSSRule> rule = nullptr; - StyleRuleBase* self = const_cast<StyleRuleBase*>(this); - switch (type()) { - case Style: - rule = CSSStyleRule::create(toStyleRule(self), parentSheet); - break; - case FontFace: - rule = CSSFontFaceRule::create(toStyleRuleFontFace(self), parentSheet); - break; - case Media: - rule = CSSMediaRule::create(toStyleRuleMedia(self), parentSheet); - break; - case Supports: - rule = CSSSupportsRule::create(toStyleRuleSupports(self), parentSheet); - break; - case Keyframes: - rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet); - break; - case Filter: - rule = CSSFilterRule::create(toStyleRuleFilter(self), parentSheet); - break; - case Unknown: - case Keyframe: - ASSERT_NOT_REACHED(); - return nullptr; - } - if (parentRule) - rule->setParentRule(parentRule); - return rule.release(); -} - unsigned StyleRule::averageSizeInBytes() { return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes();
diff --git a/sky/engine/core/css/StyleRule.h b/sky/engine/core/css/StyleRule.h index 053ff31..d5dc7b6 100644 --- a/sky/engine/core/css/StyleRule.h +++ b/sky/engine/core/css/StyleRule.h
@@ -28,8 +28,6 @@ namespace blink { -class CSSRule; -class CSSStyleRule; class CSSStyleSheet; class MutableStylePropertySet; class StylePropertySet; @@ -65,10 +63,6 @@ destroy(); } - // FIXME: There shouldn't be any need for the null parent version. - PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const; - PassRefPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; - protected: StyleRuleBase(Type type) : m_type(type) { } StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } @@ -78,8 +72,6 @@ private: void destroy(); - PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; - unsigned m_type : 5; };
diff --git a/sky/engine/core/css/StyleRuleKeyframes.cpp b/sky/engine/core/css/StyleRuleKeyframes.cpp new file mode 100644 index 0000000..9c432fc --- /dev/null +++ b/sky/engine/core/css/StyleRuleKeyframes.cpp
@@ -0,0 +1,84 @@ +/* + * Copyright (C) 2007, 2008, 2012 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 COMPUTER, 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 COMPUTER, 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 "sky/engine/config.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" + +#include "sky/engine/core/css/StyleKeyframe.h" + +namespace blink { + +StyleRuleKeyframes::StyleRuleKeyframes() + : StyleRuleBase(Keyframes) +{ +} + +StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o) + : StyleRuleBase(o) + , m_keyframes(o.m_keyframes) + , m_name(o.m_name) + , m_isPrefixed(o.m_isPrefixed) +{ +} + +StyleRuleKeyframes::~StyleRuleKeyframes() +{ +} + +void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtr<StyleKeyframe> keyframe) +{ + if (!keyframe) + return; + m_keyframes.append(keyframe); +} + +void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtr<StyleKeyframe> keyframe) +{ + m_keyframes.append(keyframe); +} + +void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) +{ + m_keyframes.remove(index); +} + +int StyleRuleKeyframes::findKeyframeIndex(const String& key) const +{ + String percentageString; + if (equalIgnoringCase(key, "from")) + percentageString = "0%"; + else if (equalIgnoringCase(key, "to")) + percentageString = "100%"; + else + percentageString = key; + + for (unsigned i = 0; i < m_keyframes.size(); ++i) { + if (m_keyframes[i]->keyText() == percentageString) + return i; + } + return -1; +} + +} // namespace blink
diff --git a/sky/engine/core/css/CSSKeyframesRule.h b/sky/engine/core/css/StyleRuleKeyframes.h similarity index 63% rename from sky/engine/core/css/CSSKeyframesRule.h rename to sky/engine/core/css/StyleRuleKeyframes.h index 599d124..a7c7655 100644 --- a/sky/engine/core/css/CSSKeyframesRule.h +++ b/sky/engine/core/css/StyleRuleKeyframes.h
@@ -23,19 +23,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SKY_ENGINE_CORE_CSS_CSSKEYFRAMESRULE_H_ -#define SKY_ENGINE_CORE_CSS_CSSKEYFRAMESRULE_H_ +#ifndef SKY_ENGINE_CORE_CSS_STYLERULEKEYFRAMES_H_ +#define SKY_ENGINE_CORE_CSS_STYLERULEKEYFRAMES_H_ -#include "sky/engine/core/css/CSSRule.h" #include "sky/engine/core/css/StyleRule.h" #include "sky/engine/wtf/Forward.h" #include "sky/engine/wtf/text/AtomicString.h" namespace blink { -class CSSRuleList; class StyleKeyframe; -class CSSKeyframeRule; class StyleRuleKeyframes final : public StyleRuleBase { public: @@ -70,46 +67,6 @@ DEFINE_STYLE_RULE_TYPE_CASTS(Keyframes); -class CSSKeyframesRule final : public CSSRule { -public: - static PassRefPtr<CSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) - { - return adoptRef(new CSSKeyframesRule(rule, sheet)); - } - - virtual ~CSSKeyframesRule(); - - virtual CSSRule::Type type() const override { return KEYFRAMES_RULE; } - virtual String cssText() const override; - virtual void reattach(StyleRuleBase*) override; - - String name() const { return m_keyframesRule->name(); } - void setName(const String&); - - CSSRuleList* cssRules(); - - void insertRule(const String& rule); - void deleteRule(const String& key); - CSSKeyframeRule* findRule(const String& key); - - // For IndexedGetter and CSSRuleList. - unsigned length() const; - CSSKeyframeRule* item(unsigned index) const; - - bool isVendorPrefixed() const { return m_isPrefixed; } - void setVendorPrefixed(bool isPrefixed) { m_isPrefixed = isPrefixed; } - -private: - CSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent); - - RefPtr<StyleRuleKeyframes> m_keyframesRule; - mutable Vector<RefPtr<CSSKeyframeRule> > m_childRuleCSSOMWrappers; - mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; - bool m_isPrefixed; -}; - -DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframesRule, KEYFRAMES_RULE); - } // namespace blink -#endif // SKY_ENGINE_CORE_CSS_CSSKEYFRAMESRULE_H_ +#endif // SKY_ENGINE_CORE_CSS_STYLERULEKEYFRAMES_H_
diff --git a/sky/engine/core/css/StyleSheet.h b/sky/engine/core/css/StyleSheet.h index 138dbf1..640fde3 100644 --- a/sky/engine/core/css/StyleSheet.h +++ b/sky/engine/core/css/StyleSheet.h
@@ -21,7 +21,6 @@ #ifndef SKY_ENGINE_CORE_CSS_STYLESHEET_H_ #define SKY_ENGINE_CORE_CSS_STYLESHEET_H_ -#include "sky/engine/bindings/core/v8/ScriptWrappable.h" #include "sky/engine/core/css/parser/CSSParserMode.h" #include "sky/engine/platform/heap/Handle.h" #include "sky/engine/wtf/Forward.h" @@ -29,14 +28,12 @@ namespace blink { -class CSSRule; class KURL; class MediaList; class Node; class StyleSheet; -class StyleSheet : public RefCounted<StyleSheet>, public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); +class StyleSheet : public RefCounted<StyleSheet> { public: StyleSheet() { @@ -44,7 +41,6 @@ virtual ~StyleSheet(); virtual Node* ownerNode() const = 0; - virtual MediaList* media() const { return 0; } virtual String type() const = 0; virtual void clearOwnerNode() = 0;
diff --git a/sky/engine/core/css/StyleSheet.idl b/sky/engine/core/css/StyleSheet.idl deleted file mode 100644 index 4bed8e1..0000000 --- a/sky/engine/core/css/StyleSheet.idl +++ /dev/null
@@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - Custom=Wrap, - SetWrapperReferenceFrom=ownerNode, -] interface StyleSheet { - readonly attribute DOMString? type; - readonly attribute Node ownerNode; - readonly attribute MediaList media; -}; -
diff --git a/sky/engine/core/css/StyleSheetList.cpp b/sky/engine/core/css/StyleSheetList.cpp index e436046..cd2557b 100644 --- a/sky/engine/core/css/StyleSheetList.cpp +++ b/sky/engine/core/css/StyleSheetList.cpp
@@ -46,13 +46,11 @@ return document()->styleEngine()->styleSheetsForStyleSheetList(*m_treeScope); } -#if !ENABLE(OILPAN) void StyleSheetList::detachFromDocument() { m_detachedStyleSheets = document()->styleEngine()->styleSheetsForStyleSheetList(*m_treeScope); m_treeScope = nullptr; } -#endif unsigned StyleSheetList::length() {
diff --git a/sky/engine/core/css/StyleSheetList.h b/sky/engine/core/css/StyleSheetList.h index de1f701..11ef4bf 100644 --- a/sky/engine/core/css/StyleSheetList.h +++ b/sky/engine/core/css/StyleSheetList.h
@@ -21,7 +21,6 @@ #ifndef SKY_ENGINE_CORE_CSS_STYLESHEETLIST_H_ #define SKY_ENGINE_CORE_CSS_STYLESHEETLIST_H_ -#include "sky/engine/bindings/core/v8/ScriptWrappable.h" #include "sky/engine/core/css/CSSStyleSheet.h" #include "sky/engine/core/dom/TreeScope.h" #include "sky/engine/wtf/Forward.h" @@ -34,8 +33,7 @@ class HTMLStyleElement; class StyleSheet; -class StyleSheetList : public RefCounted<StyleSheetList>, public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); +class StyleSheetList : public RefCounted<StyleSheetList> { public: static PassRefPtr<StyleSheetList> create(TreeScope* treeScope) { return adoptRef(new StyleSheetList(treeScope)); } ~StyleSheetList();
diff --git a/sky/engine/core/css/StyleSheetList.idl b/sky/engine/core/css/StyleSheetList.idl deleted file mode 100644 index 104a387..0000000 --- a/sky/engine/core/css/StyleSheetList.idl +++ /dev/null
@@ -1,28 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - SetWrapperReferenceFrom=document, -] interface StyleSheetList { - readonly attribute unsigned long length; - getter StyleSheet item(unsigned long index); - [NotEnumerable] getter CSSStyleSheet (DOMString name); -};
diff --git a/sky/engine/core/css/parser/BisonCSSParser-in.cpp b/sky/engine/core/css/parser/BisonCSSParser-in.cpp index e31ab84..6b0914f 100644 --- a/sky/engine/core/css/parser/BisonCSSParser-in.cpp +++ b/sky/engine/core/css/parser/BisonCSSParser-in.cpp
@@ -45,8 +45,6 @@ #include "sky/engine/core/css/CSSImageValue.h" #include "sky/engine/core/css/CSSInheritedValue.h" #include "sky/engine/core/css/CSSInitialValue.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" #include "sky/engine/core/css/CSSLineBoxContainValue.h" #include "sky/engine/core/css/CSSPrimitiveValue.h" #include "sky/engine/core/css/CSSPropertySourceData.h" @@ -65,6 +63,8 @@ #include "sky/engine/core/css/Rect.h" #include "sky/engine/core/css/StylePropertySet.h" #include "sky/engine/core/css/StyleRule.h" +#include "sky/engine/core/css/StyleKeyframe.h" +#include "sky/engine/core/css/StyleRuleKeyframes.h" #include "sky/engine/core/css/StyleSheetContents.h" #include "sky/engine/core/css/parser/CSSParserIdioms.h" #include "sky/engine/core/dom/Document.h"
diff --git a/sky/engine/core/css/parser/BisonCSSParser.h b/sky/engine/core/css/parser/BisonCSSParser.h index e4395e0..e8bb0c1 100644 --- a/sky/engine/core/css/parser/BisonCSSParser.h +++ b/sky/engine/core/css/parser/BisonCSSParser.h
@@ -48,13 +48,13 @@ namespace blink { class AnimationParseContext; +class CSSBasicShape; +class CSSBasicShapeInset; class CSSBorderImageSliceValue; class CSSPrimitiveValue; class CSSSelectorList; class CSSValue; class CSSValueList; -class CSSBasicShape; -class CSSBasicShapeInset; class Document; class Element; class ImmutableStylePropertySet; @@ -66,7 +66,6 @@ class StylePropertyShorthand; class StyleRuleBase; class StyleRuleKeyframes; -class StyleKeyframe; class StyleSheetContents; class UseCounter;
diff --git a/sky/engine/core/css/parser/CSSGrammar.y b/sky/engine/core/css/parser/CSSGrammar.y index c26ec20..86f8c6f 100644 --- a/sky/engine/core/css/parser/CSSGrammar.y +++ b/sky/engine/core/css/parser/CSSGrammar.y
@@ -26,18 +26,19 @@ #include "config.h" #include "CSSPropertyNames.h" -#include "core/css/CSSKeyframeRule.h" -#include "core/css/CSSKeyframesRule.h" -#include "core/css/parser/BisonCSSParser.h" -#include "core/css/parser/CSSParserMode.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSSelector.h" #include "core/css/CSSSelectorList.h" #include "core/css/MediaList.h" #include "core/css/MediaQueryExp.h" +#include "core/css/StyleKeyframe.h" #include "core/css/StyleRule.h" +#include "core/css/StyleRuleKeyframes.h" #include "core/css/StyleSheetContents.h" +#include "core/css/parser/BisonCSSParser.h" +#include "core/css/parser/CSSParserMode.h" #include "core/dom/Document.h" +#include "sky/engine/core/css/MediaList.h" #include "wtf/FastMalloc.h" #include <stdlib.h> #include <string.h>
diff --git a/sky/engine/core/css/parser/CSSPropertyParser.cpp b/sky/engine/core/css/parser/CSSPropertyParser.cpp index fbd3298..2ee6859 100644 --- a/sky/engine/core/css/parser/CSSPropertyParser.cpp +++ b/sky/engine/core/css/parser/CSSPropertyParser.cpp
@@ -46,8 +46,6 @@ #include "sky/engine/core/css/CSSImageValue.h" #include "sky/engine/core/css/CSSInheritedValue.h" #include "sky/engine/core/css/CSSInitialValue.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" #include "sky/engine/core/css/CSSLineBoxContainValue.h" #include "sky/engine/core/css/CSSPrimitiveValue.h" #include "sky/engine/core/css/CSSPropertyMetadata.h"
diff --git a/sky/engine/core/css/parser/CSSTokenizer-in.cpp b/sky/engine/core/css/parser/CSSTokenizer-in.cpp index 0b14bd6..5390bee 100644 --- a/sky/engine/core/css/parser/CSSTokenizer-in.cpp +++ b/sky/engine/core/css/parser/CSSTokenizer-in.cpp
@@ -27,7 +27,6 @@ #include "sky/engine/config.h" #include "sky/engine/core/css/parser/CSSTokenizer.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" #include "sky/engine/core/css/MediaQuery.h" #include "sky/engine/core/css/StyleRule.h" #include "sky/engine/core/css/parser/BisonCSSParser.h"
diff --git a/sky/engine/core/css/resolver/StyleResolver.cpp b/sky/engine/core/css/resolver/StyleResolver.cpp index 56fbc39..5fa2b15 100644 --- a/sky/engine/core/css/resolver/StyleResolver.cpp +++ b/sky/engine/core/css/resolver/StyleResolver.cpp
@@ -42,17 +42,14 @@ #include "sky/engine/core/animation/css/CSSAnimations.h" #include "sky/engine/core/css/CSSCalculationValue.h" #include "sky/engine/core/css/CSSFontSelector.h" -#include "sky/engine/core/css/CSSKeyframeRule.h" -#include "sky/engine/core/css/CSSKeyframesRule.h" -#include "sky/engine/core/css/CSSRuleList.h" #include "sky/engine/core/css/CSSSelector.h" -#include "sky/engine/core/css/CSSStyleRule.h" #include "sky/engine/core/css/CSSValueList.h" #include "sky/engine/core/css/CSSValuePool.h" #include "sky/engine/core/css/ElementRuleCollector.h" #include "sky/engine/core/css/FontFace.h" #include "sky/engine/core/css/MediaQueryEvaluator.h" #include "sky/engine/core/css/RuleSet.h" +#include "sky/engine/core/css/StyleKeyframe.h" #include "sky/engine/core/css/StylePropertySet.h" #include "sky/engine/core/css/StyleSheetContents.h" #include "sky/engine/core/css/parser/BisonCSSParser.h"
diff --git a/sky/engine/core/css/resolver/StyleResolver.h b/sky/engine/core/css/resolver/StyleResolver.h index d587b76..ab09b89 100644 --- a/sky/engine/core/css/resolver/StyleResolver.h +++ b/sky/engine/core/css/resolver/StyleResolver.h
@@ -43,7 +43,6 @@ class AnimationTimeline; class CSSAnimationUpdate; class CSSFontSelector; -class CSSRuleList; class CSSSelector; class CSSStyleSheet; class CSSValue;
diff --git a/sky/engine/core/dom/Document.idl b/sky/engine/core/dom/Document.idl index c4921e3..171ec4d 100644 --- a/sky/engine/core/dom/Document.idl +++ b/sky/engine/core/dom/Document.idl
@@ -47,8 +47,6 @@ [ImplementedAs=executingWindow] readonly attribute Window defaultView; - readonly attribute StyleSheetList styleSheets; - readonly attribute DOMString contentType; [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString dir;
diff --git a/sky/engine/core/dom/shadow/ShadowRoot.idl b/sky/engine/core/dom/shadow/ShadowRoot.idl index d052f54..e37e91a 100644 --- a/sky/engine/core/dom/shadow/ShadowRoot.idl +++ b/sky/engine/core/dom/shadow/ShadowRoot.idl
@@ -34,6 +34,5 @@ Element elementFromPoint([Default=Undefined] optional long x, [Default=Undefined] optional long y); - readonly attribute StyleSheetList styleSheets; readonly attribute Element host; };
diff --git a/sky/engine/core/editing/EditingStyle.cpp b/sky/engine/core/editing/EditingStyle.cpp index dbffa71..95a2979 100644 --- a/sky/engine/core/editing/EditingStyle.cpp +++ b/sky/engine/core/editing/EditingStyle.cpp
@@ -31,8 +31,6 @@ #include "sky/engine/bindings/core/v8/ExceptionStatePlaceholder.h" #include "sky/engine/core/css/CSSComputedStyleDeclaration.h" #include "sky/engine/core/css/CSSPropertyMetadata.h" -#include "sky/engine/core/css/CSSRuleList.h" -#include "sky/engine/core/css/CSSStyleRule.h" #include "sky/engine/core/css/CSSValueList.h" #include "sky/engine/core/css/CSSValuePool.h" #include "sky/engine/core/css/FontSize.h"
diff --git a/sky/engine/core/frame/LocalDOMWindow.cpp b/sky/engine/core/frame/LocalDOMWindow.cpp index cf4eb3d..58eb8b8 100644 --- a/sky/engine/core/frame/LocalDOMWindow.cpp +++ b/sky/engine/core/frame/LocalDOMWindow.cpp
@@ -38,7 +38,6 @@ #include "sky/engine/bindings/core/v8/SerializedScriptValue.h" #include "sky/engine/core/app/Application.h" #include "sky/engine/core/css/CSSComputedStyleDeclaration.h" -#include "sky/engine/core/css/CSSRuleList.h" #include "sky/engine/core/css/DOMWindowCSS.h" #include "sky/engine/core/css/MediaQueryList.h" #include "sky/engine/core/css/MediaQueryMatcher.h"
diff --git a/sky/engine/core/frame/LocalDOMWindow.h b/sky/engine/core/frame/LocalDOMWindow.h index 47d4493..45cff84 100644 --- a/sky/engine/core/frame/LocalDOMWindow.h +++ b/sky/engine/core/frame/LocalDOMWindow.h
@@ -41,7 +41,6 @@ namespace blink { class Application; -class CSSRuleList; class CSSStyleDeclaration; class Console; class DOMSelection;
diff --git a/sky/engine/core/html/HTMLStyleElement.idl b/sky/engine/core/html/HTMLStyleElement.idl index ed91655..947286e 100644 --- a/sky/engine/core/html/HTMLStyleElement.idl +++ b/sky/engine/core/html/HTMLStyleElement.idl
@@ -21,7 +21,4 @@ interface HTMLStyleElement : HTMLElement { [Reflect] attribute DOMString media; [Reflect] attribute DOMString type; - - // DOM Level 2 Style - readonly attribute StyleSheet sheet; };