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

Unified Diff: Source/core/dom/Element.cpp

Issue 135273010: Enable HTMLImageElement to avoid immediate src loading when parsed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « Source/core/dom/Element.h ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 14e2950fba9559fadd97d5d4c6508511f4520f7f..832a65fb30d66113858c7e539ba4cefd359a8e65 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -916,6 +916,8 @@ void Element::setSynchronizedLazyAttribute(const QualifiedName& name, const Atom
ALWAYS_INLINE void Element::setAttributeInternal(size_t index, const QualifiedName& name, const AtomicString& newValue, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute)
{
+ m_parserSet = false;
+
if (newValue.isNull()) {
if (index != kNotFound)
removeAttributeInternal(index, inSynchronizationOfLazyAttribute);
@@ -1198,6 +1200,8 @@ void Element::parserSetAttributes(const Vector<Attribute>& attributeVector)
else
m_elementData = ShareableElementData::createWithAttributes(attributeVector);
+ m_parserSet = true;
+
// Use attributeVector instead of m_elementData because attributeChanged might modify m_elementData.
for (unsigned i = 0; i < attributeVector.size(); ++i)
attributeChangedFromParserOrByCloning(attributeVector[i].name(), attributeVector[i].value(), ModifiedDirectly);
@@ -2095,6 +2099,8 @@ void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribu
{
ASSERT_WITH_SECURITY_IMPLICATION(index < attributeCount());
+ m_parserSet = false;
+
UniqueElementData* elementData = ensureUniqueElementData();
QualifiedName name = elementData->attributeItem(index)->name();
@@ -2116,6 +2122,8 @@ void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribu
void Element::addAttributeInternal(const QualifiedName& name, const AtomicString& value, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute)
{
+ m_parserSet = false;
+
if (!inSynchronizationOfLazyAttribute)
willModifyAttribute(name, nullAtom, value);
ensureUniqueElementData()->addAttribute(name, value);
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698