Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 1214633005: Remove CSS clients of ImageResource (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/css/resolver/StyleResourceLoader.cpp ('k') | sky/engine/core/page/EventHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index 34ca67d1a418b866317057b4a9d5f2e5ff6030c2..3bfb444170bc6c376b96a160bd22ca2a24b44e9b 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -32,7 +32,6 @@
#include "sky/engine/bindings/exception_state.h"
#include "sky/engine/core/animation/AnimationTimeline.h"
#include "sky/engine/core/animation/css/CSSAnimations.h"
-#include "sky/engine/core/css/CSSImageValue.h"
#include "sky/engine/core/css/CSSStyleSheet.h"
#include "sky/engine/core/css/CSSValuePool.h"
#include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h"
@@ -1430,39 +1429,9 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue));
}
-static bool needsURLResolutionForInlineStyle(const Element& element, const Document& oldDocument, const Document& newDocument)
-{
- if (oldDocument == newDocument)
- return false;
- if (oldDocument.baseURL() == newDocument.baseURL())
- return false;
- const StylePropertySet* style = element.inlineStyle();
- if (!style)
- return false;
- for (unsigned i = 0; i < style->propertyCount(); ++i) {
- // FIXME: Should handle all URL-based properties: CSSImageSetValue, CSSCursorImageValue, etc.
- if (style->propertyAt(i).value()->isImageValue())
- return true;
- }
- return false;
-}
-
-static void reResolveURLsInInlineStyle(const Document& document, MutableStylePropertySet& style)
-{
- for (unsigned i = 0; i < style.propertyCount(); ++i) {
- StylePropertySet::PropertyReference property = style.propertyAt(i);
- // FIXME: Should handle all URL-based properties: CSSImageSetValue, CSSCursorImageValue, etc.
- if (property.value()->isImageValue())
- toCSSImageValue(property.value())->reResolveURL(document);
- }
-}
-
void Element::didMoveToNewDocument(Document& oldDocument)
{
Node::didMoveToNewDocument(oldDocument);
-
- if (needsURLResolutionForInlineStyle(*this, oldDocument, document()))
- reResolveURLsInInlineStyle(document(), ensureMutableInlineStyle());
}
void Element::cloneAttributesFromElement(const Element& other)
@@ -1484,7 +1453,7 @@ void Element::cloneAttributesFromElement(const Element& other)
if (other.m_elementData->isUnique())
const_cast<Element&>(other).m_elementData = toUniqueElementData(other.m_elementData)->makeShareableCopy();
- if (!other.m_elementData->isUnique() && !needsURLResolutionForInlineStyle(other, other.document(), document()))
+ if (!other.m_elementData->isUnique())
m_elementData = other.m_elementData;
else
m_elementData = other.m_elementData->makeUniqueCopy();
« no previous file with comments | « sky/engine/core/css/resolver/StyleResourceLoader.cpp ('k') | sky/engine/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698