diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
| commit | be01689f43cf6882cf670d33df49ead1f570c53a (patch) | |
| tree | 4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/WebCore/dom/StyledElement.cpp | |
| parent | a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff) | |
| download | qtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz | |
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/WebCore/dom/StyledElement.cpp')
| -rw-r--r-- | Source/WebCore/dom/StyledElement.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/WebCore/dom/StyledElement.cpp b/Source/WebCore/dom/StyledElement.cpp index a992644c1..43747b806 100644 --- a/Source/WebCore/dom/StyledElement.cpp +++ b/Source/WebCore/dom/StyledElement.cpp @@ -37,9 +37,11 @@ #include "Document.h" #include "HTMLNames.h" #include "HTMLParserIdioms.h" +#include "ScriptableDocumentParser.h" #include "StylePropertySet.h" #include "StyleResolver.h" #include <wtf/HashFunctions.h> +#include <wtf/text/TextPosition.h> using namespace std; @@ -126,13 +128,21 @@ void StyledElement::updateStyleAttribute() const const_cast<StyledElement*>(this)->setAttribute(styleAttr, inlineStyle->asText(), InUpdateStyleAttribute); } +StyledElement::StyledElement(const QualifiedName& name, Document* document, ConstructionType type) + : Element(name, document, type) + , m_startLineNumber(WTF::OrdinalNumber::beforeFirst()) +{ + if (document && document->scriptableDocumentParser() && !document->isInDocumentWrite()) + m_startLineNumber = document->scriptableDocumentParser()->lineNumber(); +} + StyledElement::~StyledElement() { destroyInlineStyle(); } -CSSStyleDeclaration* StyledElement::style() -{ +CSSStyleDeclaration* StyledElement::style() +{ return ensureAttributeData()->ensureMutableInlineStyle(this)->ensureInlineCSSStyleDeclaration(this); } @@ -173,7 +183,7 @@ void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, Sh if (shouldReparse) { if (newStyleString.isNull()) destroyInlineStyle(); - else if (document()->contentSecurityPolicy()->allowInlineStyle()) + else if (document()->contentSecurityPolicy()->allowInlineStyle(document()->url(), m_startLineNumber)) ensureAttributeData()->updateInlineStyleAvoidingMutation(this, newStyleString); setIsStyleAttributeValid(); } |
