Source/WebCore/ChangeLog

 12011-11-25 Andreas Kling <kling@webkit.org>
 2
 3 Factor element pointer out of CSSMutableStyleDeclaration.
 4 <http://webkit.org/b/73121>
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Move the StyledElement pointer out of CSSMutableStyleDeclaration and into a subclass
 9 for the cases where it's needed. This reduces the size of vanilla style declarations
 10 by one CPU word (4 or 8 bytes, depending on architecture.)
 11
 12 * css/CSSMutableStyleDeclaration.h:
 13 (WebCore::CSSElementStyleDeclaration::element):
 14 (WebCore::CSSElementStyleDeclaration::setElement):
 15 (WebCore::CSSElementStyleDeclaration::CSSElementStyleDeclaration):
 16 (WebCore::CSSElementStyleDeclaration::~CSSElementStyleDeclaration):
 17
 18 Added CSSElementStyleDeclaration, a common parent class for inline styles
 19 and mapped attributes. It extends CSSMutableStyleDeclaration by adding a backpointer
 20 to the StyledElement that owns it.
 21
 22 * GNUmakefile.list.am:
 23 * Target.pri:
 24 * WebCore.gypi:
 25 * WebCore.vcproj/WebCore.vcproj:
 26 * WebCore.xcodeproj/project.pbxproj:
 27 * css/CSSInlineStyleDeclaration.h: Added.
 28 (WebCore::CSSInlineStyleDeclaration::~CSSInlineStyleDeclaration):
 29 (WebCore::CSSInlineStyleDeclaration::create):
 30 (WebCore::CSSInlineStyleDeclaration::CSSInlineStyleDeclaration):
 31
 32 Added CSSInlineStyleDeclaration.
 33
 34 * bindings/js/JSDOMBinding.h:
 35 (WebCore::root):
 36 * css/CSSMutableStyleDeclaration.cpp:
 37 (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc):
 38 * css/CSSStyleRule.cpp:
 39 (WebCore::CSSStyleRule::setSelectorText):
 40
 41 Only follow the associated element on CSSElementStyleDeclarations.
 42
 43 * css/CSSMutableStyleDeclaration.cpp:
 44 (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
 45 (WebCore::CSSMutableStyleDeclaration::operator=):
 46
 47 Remove comment about m_element since the field was moved to a subclass.
 48
 49 * css/CSSStyleDeclaration.cpp:
 50 (WebCore::CSSStyleDeclaration::CSSStyleDeclaration):
 51 * css/CSSStyleDeclaration.h:
 52 (WebCore::CSSStyleDeclaration::isElementStyleDeclaration):
 53 (WebCore::CSSStyleDeclaration::isInlineStyleDeclaration):
 54
 55 We no longer need to track whether a style declaration is mutable or not,
 56 so the constructors are slightly simplified.
 57 Added two bits (isElementStyleDeclaration and isInlineStyleDeclaration) for
 58 runtime type checking. These are protected and set by the CSSElementStyleDeclaration
 59 constructor.
 60
 61 * dom/CSSMappedAttributeDeclaration.h:
 62 (WebCore::CSSMappedAttributeDeclaration::create):
 63 (WebCore::CSSMappedAttributeDeclaration::CSSMappedAttributeDeclaration):
 64
 65 Remove pointless CSSRule* argument to constructor since we always passed 0.
 66
 67 * dom/StyledElement.h:
 68 (WebCore::StyledElement::inlineStyleDecl):
 69 * dom/StyledElement.cpp:
 70 (WebCore::StyledElement::createInlineStyleDecl):
 71 (WebCore::StyledElement::getInlineStyleDecl):
 72 (WebCore::StyledElement::addSubresourceAttributeURLs):
 73
 74 Make the inline style on StyledElement a CSSInlineStyleDeclaration.
 75
 76 * inspector/InspectorCSSAgent.cpp:
 77 (WebCore::InspectorCSSAgent::inlineStyleElement):
 78
 79 Slightly simplified by having CSSInlineStyleDeclaration.
 80
1812011-11-23 Yury Semikhatsky <yurys@chromium.org>
282
383 Web Inspector: exceptions in shared workers should be logged to web inspector console

Source/WebCore/GNUmakefile.list.am

@@webcore_sources += \
10091009 Source/WebCore/css/CSSInheritedValue.h \
10101010 Source/WebCore/css/CSSInitialValue.cpp \
10111011 Source/WebCore/css/CSSInitialValue.h \
 1012 Source/WebCore/css/CSSInlineStyleDeclaration.h \
10121013 Source/WebCore/css/CSSLineBoxContainValue.cpp \
10131014 Source/WebCore/css/CSSLineBoxContainValue.h \
10141015 Source/WebCore/css/CSSMediaRule.cpp \

Source/WebCore/Target.pri

@@HEADERS += \
15101510 css/CSSImportRule.h \
15111511 css/CSSInheritedValue.h \
15121512 css/CSSInitialValue.h \
 1513 css/CSSInlineStyleDeclaration.h \
15131514 css/CSSMediaRule.h \
15141515 css/CSSMutableStyleDeclaration.h \
15151516 css/CSSOMUtils.h \

Source/WebCore/WebCore.gypi

488488 'css/CSSHelper.h',
489489 'css/CSSImageGeneratorValue.h',
490490 'css/CSSImageValue.h',
 491 'css/CSSInlineStyleDeclaration.h',
491492 'css/CSSLineBoxContainValue.h',
492493 'css/CSSMutableStyleDeclaration.h',
493494 'css/CSSParserValues.h',

Source/WebCore/WebCore.vcproj/WebCore.vcproj

3251432514 >
3251532515 </File>
3251632516 <File
 32517 RelativePath="..\css\CSSInlineStyleDeclaration.h"
 32518 >
 32519 </File>
 32520 <File
3251732521 RelativePath="..\css\CSSLineBoxContainValue.cpp"
3251832522 >
3251932523 </File>

Source/WebCore/WebCore.xcodeproj/project.pbxproj

29482948 8CADF2AB135C7B36009EF43F /* LevelDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A5135C7B36009EF43F /* LevelDBDatabase.h */; };
29492949 8CADF2AD135C7B36009EF43F /* LevelDBIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A7135C7B36009EF43F /* LevelDBIterator.h */; };
29502950 8CADF2AE135C7B36009EF43F /* LevelDBSlice.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A8135C7B36009EF43F /* LevelDBSlice.h */; };
 2951 8CF7DDE4147ECF940041A6F2 /* CSSInlineStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
29512952 8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F6756191288B17B0047ACA3 /* EventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
29522953 8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; };
29532954 9001774012E0347800648462 /* OESStandardDerivatives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9001773D12E0347800648462 /* OESStandardDerivatives.cpp */; };

1015310154 8CADF2A5135C7B36009EF43F /* LevelDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBDatabase.h; sourceTree = "<group>"; };
1015410155 8CADF2A7135C7B36009EF43F /* LevelDBIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBIterator.h; sourceTree = "<group>"; };
1015510156 8CADF2A8135C7B36009EF43F /* LevelDBSlice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBSlice.h; sourceTree = "<group>"; };
 10157 8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSInlineStyleDeclaration.h; sourceTree = "<group>"; };
1015610158 8F6756191288B17B0047ACA3 /* EventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventQueue.h; sourceTree = "<group>"; };
1015710159 8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; };
1015810160 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; };

2061820620 F523D18402DE42E8018635CA /* css */ = {
2061920621 isa = PBXGroup;
2062020622 children = (
 20623 8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */,
2062120624 5038BC0614711CDB0095E0D1 /* WebKitCSSShaderValue.cpp */,
2062220625 50B42157146976960087E604 /* WebKitCSSShaderValue.h */,
2062320626 AD03AAF81468453900A39B5B /* CSSValue.cpp */,

2169121694 isa = PBXHeadersBuildPhase;
2169221695 buildActionMask = 2147483647;
2169321696 files = (
 21697 8CF7DDE4147ECF940041A6F2 /* CSSInlineStyleDeclaration.h in Headers */,
2169421698 A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */,
2169521699 3106037014327D2E00ABF4BA /* WebKitCSSFilterValue.h in Headers */,
2169621700 A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */,

Source/WebCore/bindings/js/JSDOMBinding.h

2222#ifndef JSDOMBinding_h
2323#define JSDOMBinding_h
2424
 25#include "CSSMutableStyleDeclaration.h"
2526#include "CSSRule.h"
2627#include "CSSStyleSheet.h"
2728#include "JSDOMGlobalObject.h"

@@enum ParameterMissingPolicy {
206207 return root(parentRule);
207208 if (CSSStyleSheet* styleSheet = style->parentStyleSheet())
208209 return root(styleSheet);
209  if (style->isMutableStyleDeclaration()) {
210  if (Node* node = static_cast<CSSMutableStyleDeclaration*>(style)->element())
211  return root(node);
 210 if (style->isElementStyleDeclaration()) {
 211 if (StyledElement* element = static_cast<CSSElementStyleDeclaration*>(style)->element())
 212 return root(element);
212213 }
213214 return style;
214215 }

Source/WebCore/css/CSSInlineStyleDeclaration.h

 1/*
 2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
 3 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27#ifndef CSSInlineStyleDeclaration_h
 28#define CSSInlineStyleDeclaration_h
 29
 30#include "CSSMutableStyleDeclaration.h"
 31
 32namespace WebCore {
 33
 34class CSSInlineStyleDeclaration : public CSSElementStyleDeclaration {
 35public:
 36 virtual ~CSSInlineStyleDeclaration() { }
 37
 38 static PassRefPtr<CSSInlineStyleDeclaration> create()
 39 {
 40 return adoptRef(new CSSInlineStyleDeclaration);
 41 }
 42
 43private:
 44 CSSInlineStyleDeclaration()
 45 : CSSElementStyleDeclaration(/* isInline */ true)
 46 {
 47 }
 48};
 49
 50} // namespace WebCore
 51
 52#endif // CSSInlineStyleDeclaration_h

Source/WebCore/css/CSSMutableStyleDeclaration.cpp

@@CSSMutableStyleDeclaration* StyleAttributeMutationScope::s_currentDecl = 0;
107107#endif // ENABLE(MUTATION_OBSERVERS)
108108
109109CSSMutableStyleDeclaration::CSSMutableStyleDeclaration()
110  : CSSStyleDeclaration(0, /* isMutable */ true)
111  , m_element(0)
 110 : CSSStyleDeclaration(0)
112111{
113112 // This constructor is used for various inline style declarations, so disable strict parsing.
114113 m_strictParsing = false;
115114}
116115
117116CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent)
118  : CSSStyleDeclaration(parent, /* isMutable */ true)
119  , m_element(0)
 117 : CSSStyleDeclaration(parent)
120118{
121119}
122120
123121CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const Vector<CSSProperty>& properties)
124  : CSSStyleDeclaration(parent, /* isMutable */ true)
 122 : CSSStyleDeclaration(parent)
125123 , m_properties(properties)
126  , m_element(0)
127124{
128125 m_properties.shrinkToFit();
129126 // FIXME: This allows duplicate properties.
130127}
131128
132129CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CSSProperty* const * properties, int numProperties)
133  : CSSStyleDeclaration(parent, /* isMutable */ true)
134  , m_element(0)
 130 : CSSStyleDeclaration(parent)
135131{
136132 m_properties.reserveInitialCapacity(numProperties);
137133 HashMap<int, bool> candidates;

@@CSSMutableStyleDeclaration::~CSSMutableStyleDeclaration()
156152CSSMutableStyleDeclaration& CSSMutableStyleDeclaration::operator=(const CSSMutableStyleDeclaration& other)
157153{
158154 ASSERT(!m_iteratorCount);
159  // don't attach it to the same element, just leave the current m_element value
160155 m_properties = other.m_properties;
161156 m_strictParsing = other.m_strictParsing;
162157 return *this;

@@String CSSMutableStyleDeclaration::removeProperty(int propertyID, bool notifyCha
614609 return value;
615610}
616611
617 bool CSSMutableStyleDeclaration::isInlineStyleDeclaration()
618 {
619  // FIXME: Ideally, this should be factored better and there
620  // should be a subclass of CSSMutableStyleDeclaration just
621  // for inline style declarations that handles this
622  return m_element && m_element->inlineStyleDecl() == this;
623 }
624 
625612void CSSMutableStyleDeclaration::setNeedsStyleRecalc()
626613{
627  if (m_element) {
628  if (isInlineStyleDeclaration()) {
629  m_element->setNeedsStyleRecalc(InlineStyleChange);
630  m_element->invalidateStyleAttribute();
631  if (m_element->document())
632  InspectorInstrumentation::didInvalidateStyleAttr(m_element->document(), m_element);
633  } else
634  m_element->setNeedsStyleRecalc(FullStyleChange);
 614 if (isElementStyleDeclaration() && static_cast<CSSElementStyleDeclaration*>(this)->element()) {
 615 StyledElement* element = static_cast<CSSElementStyleDeclaration*>(this)->element();
 616 if (!isInlineStyleDeclaration())
 617 element->setNeedsStyleRecalc(FullStyleChange);
 618 else {
 619 element->setNeedsStyleRecalc(InlineStyleChange);
 620 element->invalidateStyleAttribute();
 621 if (Document* document = element->document())
 622 InspectorInstrumentation::didInvalidateStyleAttr(document, element);
 623 }
635624 return;
636625 }
637626

Source/WebCore/css/CSSMutableStyleDeclaration.h

@@public:
8383 const_iterator begin() { return const_iterator(this, m_properties.begin()); }
8484 const_iterator end() { return const_iterator(this, m_properties.end()); }
8585
86  void setElement(StyledElement* element) { m_element = element; }
87 
88  StyledElement* element() const { return m_element; }
89 
9086 virtual String cssText() const;
9187 virtual void setCssText(const String&, ExceptionCode&);
9288

@@public:
139135
140136 bool propertiesEqual(const CSSMutableStyleDeclaration* o) const { return m_properties == o->m_properties; }
141137
142  bool isInlineStyleDeclaration();
143 
144138protected:
145139 CSSMutableStyleDeclaration(CSSRule* parentRule);
 140 CSSMutableStyleDeclaration();
146141
147142private:
148  CSSMutableStyleDeclaration();
149143 CSSMutableStyleDeclaration(CSSRule* parentRule, const Vector<CSSProperty>&);
150144 CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
151145

@@private:
178172
179173 Vector<CSSProperty, 4> m_properties;
180174
181  StyledElement* m_element;
182 
183175 friend class CSSMutableStyleDeclarationConstIterator;
184176};
185177
 178class CSSElementStyleDeclaration : public CSSMutableStyleDeclaration {
 179public:
 180 StyledElement* element() const { return m_element; }
 181 void setElement(StyledElement* element) { m_element = element; }
 182
 183protected:
 184 CSSElementStyleDeclaration(bool isInline)
 185 : CSSMutableStyleDeclaration()
 186 , m_element(0)
 187 {
 188 m_isElementStyleDeclaration = true;
 189 m_isInlineStyleDeclaration = isInline;
 190 }
 191
 192 virtual ~CSSElementStyleDeclaration() { }
 193
 194private:
 195 StyledElement* m_element;
 196};
 197
186198inline CSSMutableStyleDeclarationConstIterator::CSSMutableStyleDeclarationConstIterator(const CSSMutableStyleDeclaration* decl, CSSProperty* current)
187199: m_decl(decl)
188200, m_current(current)

Source/WebCore/css/CSSStyleDeclaration.cpp

@@using namespace WTF;
3838
3939namespace WebCore {
4040
41 CSSStyleDeclaration::CSSStyleDeclaration(CSSRule* parent, bool isMutable)
 41CSSStyleDeclaration::CSSStyleDeclaration(CSSRule* parent)
4242 : m_strictParsing(!parent || parent->useStrictParsing())
4343#ifndef NDEBUG
4444 , m_iteratorCount(0)
4545#endif
46  , m_isMutableStyleDeclaration(isMutable)
 46 , m_isElementStyleDeclaration(false)
 47 , m_isInlineStyleDeclaration(false)
4748 , m_parentIsRule(true)
4849 , m_parentRule(parent)
4950{

Source/WebCore/css/CSSStyleDeclaration.h

@@public:
102102 void showStyle();
103103#endif
104104
105  bool isMutableStyleDeclaration() const { return m_isMutableStyleDeclaration; }
 105 bool isElementStyleDeclaration() const { return m_isElementStyleDeclaration; }
 106 bool isInlineStyleDeclaration() const { return m_isInlineStyleDeclaration; }
106107
107108protected:
108  CSSStyleDeclaration(CSSRule* parentRule = 0, bool isMutable = false);
 109 CSSStyleDeclaration(CSSRule* parentRule = 0);
109110
110111 virtual bool cssPropertyMatches(const CSSProperty*) const;
111112
112  // These bits are only used by CSSMutableStyleDeclaration but kept here
 113 // The bits in this section are only used by specific subclasses but kept here
113114 // to maximize struct packing.
 115
 116 // CSSMutableStyleDeclaration bits:
114117 bool m_strictParsing : 1;
115118#ifndef NDEBUG
116119 unsigned m_iteratorCount : 4;
117120#endif
118121
 122 // CSSElementStyleDeclaration bits:
 123 bool m_isElementStyleDeclaration : 1;
 124 bool m_isInlineStyleDeclaration : 1;
 125
119126private:
120  bool m_isMutableStyleDeclaration : 1;
121127 bool m_parentIsRule : 1;
122128 union {
123129 CSSRule* m_parentRule;

Source/WebCore/css/CSSStyleRule.cpp

@@void CSSStyleRule::setSelectorText(const String& selectorText)
6666 if (CSSStyleSheet* styleSheet = m_style->parentStyleSheet())
6767 doc = styleSheet->findDocument();
6868
69  if (!doc)
70  doc = m_style->element() ? m_style->element()->document() : 0;
 69 if (!doc && m_style->isElementStyleDeclaration()) {
 70 if (StyledElement* element = static_cast<CSSElementStyleDeclaration*>(m_style.get())->element())
 71 doc = element->document();
 72 }
7173
7274 if (!doc)
7375 return;

Source/WebCore/dom/CSSMappedAttributeDeclaration.h

3131
3232namespace WebCore {
3333
34 class CSSMappedAttributeDeclaration : public CSSMutableStyleDeclaration {
 34class CSSMappedAttributeDeclaration : public CSSElementStyleDeclaration {
3535public:
3636 static PassRefPtr<CSSMappedAttributeDeclaration> create()
3737 {
38  return adoptRef(new CSSMappedAttributeDeclaration(0));
 38 return adoptRef(new CSSMappedAttributeDeclaration);
3939 }
4040
4141 virtual ~CSSMappedAttributeDeclaration();

@@public:
4848 }
4949
5050private:
51  CSSMappedAttributeDeclaration(CSSRule* parentRule)
52  : CSSMutableStyleDeclaration(parentRule)
 51 CSSMappedAttributeDeclaration()
 52 : CSSElementStyleDeclaration(/* isInline */ false)
5353 , m_entryType(eNone)
5454 , m_attrName(anyQName())
5555 {
5656 }
57 
 57
5858 MappedAttributeEntry m_entryType;
5959 QualifiedName m_attrName;
6060 AtomicString m_attrValue;

Source/WebCore/dom/StyledElement.cpp

2525#include "StyledElement.h"
2626
2727#include "Attribute.h"
28 #include "CSSMutableStyleDeclaration.h"
 28#include "CSSInlineStyleDeclaration.h"
2929#include "CSSStyleSelector.h"
3030#include "CSSStyleSheet.h"
3131#include "CSSValueKeywords.h"

@@PassRefPtr<Attribute> StyledElement::createAttribute(const QualifiedName& name,
129129
130130void StyledElement::createInlineStyleDecl()
131131{
132  m_inlineStyleDecl = CSSMutableStyleDeclaration::create();
 132 m_inlineStyleDecl = CSSInlineStyleDeclaration::create();
133133 m_inlineStyleDecl->setParentStyleSheet(document()->elementSheet());
134134 m_inlineStyleDecl->setElement(this);
135135 m_inlineStyleDecl->setStrictParsing(isHTMLElement() && !document()->inQuirksMode());

@@void StyledElement::parseMappedAttribute(Attribute* attr)
249249 }
250250}
251251
252 CSSMutableStyleDeclaration* StyledElement::getInlineStyleDecl()
 252CSSInlineStyleDeclaration* StyledElement::getInlineStyleDecl()
253253{
254254 if (!m_inlineStyleDecl)
255255 createInlineStyleDecl();

@@void StyledElement::copyNonAttributeProperties(const Element *sourceElement)
446446
447447void StyledElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
448448{
449  if (CSSMutableStyleDeclaration* style = inlineStyleDecl())
 449 if (CSSInlineStyleDeclaration* style = inlineStyleDecl())
450450 style->addSubresourceStyleURLs(urls);
451451}
452452

Source/WebCore/dom/StyledElement.h

2525#ifndef StyledElement_h
2626#define StyledElement_h
2727
 28#include "CSSInlineStyleDeclaration.h"
2829#include "Element.h"
2930#include "MappedAttributeEntry.h"
3031

@@namespace WebCore {
3233
3334class Attribute;
3435class CSSMappedAttributeDeclaration;
35 class CSSMutableStyleDeclaration;
3636
3737class StyledElement : public Element {
3838public:

@@public:
5454 static CSSMappedAttributeDeclaration* getMappedAttributeDecl(MappedAttributeEntry, Attribute*);
5555 static void setMappedAttributeDecl(MappedAttributeEntry, Attribute*, CSSMappedAttributeDeclaration*);
5656
57  CSSMutableStyleDeclaration* inlineStyleDecl() const { return m_inlineStyleDecl.get(); }
 57 CSSInlineStyleDeclaration* inlineStyleDecl() const { return m_inlineStyleDecl.get(); }
5858 virtual bool canHaveAdditionalAttributeStyleDecls() const { return false; }
5959 virtual void additionalAttributeStyleDecls(Vector<CSSMutableStyleDeclaration*>&) { }
60  CSSMutableStyleDeclaration* getInlineStyleDecl();
 60 CSSInlineStyleDeclaration* getInlineStyleDecl();
6161 CSSStyleDeclaration* style();
6262 void invalidateStyleAttribute();
6363

@@private:
9393 void destroyInlineStyleDecl();
9494 virtual void updateStyleAttribute() const;
9595
96  RefPtr<CSSMutableStyleDeclaration> m_inlineStyleDecl;
 96 RefPtr<CSSInlineStyleDeclaration> m_inlineStyleDecl;
9797};
9898
9999inline const SpaceSplitString& StyledElement::classNames() const

Source/WebCore/inspector/InspectorCSSAgent.cpp

@@void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<Inspector
442442// static
443443Element* InspectorCSSAgent::inlineStyleElement(CSSStyleDeclaration* style)
444444{
445  if (!style || !style->isMutableStyleDeclaration())
 445 if (!style || !style->isInlineStyleDeclaration())
446446 return 0;
447  CSSMutableStyleDeclaration* mutableStyle = static_cast<CSSMutableStyleDeclaration*>(style);
448  if (!mutableStyle->isInlineStyleDeclaration())
449  return 0;
450  return mutableStyle->element();
 447 return static_cast<CSSInlineStyleDeclaration*>(style)->element();
451448}
452449
453450InspectorStyleSheetForInlineStyle* InspectorCSSAgent::asInspectorStyleSheet(Element* element)