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

Unified Diff: Source/core/html/HTMLObjectElement.cpp

Issue 135103003: Updating <object> upon changing "data", "classid", "type" attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase (another TestExpectations conflict) 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 | « LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLObjectElement.cpp
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index 76d2709da0c1a3b12500a1c79257659dad30e836..51ec27e27a930e7e152f6e831cc0925fd9092400 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -98,22 +98,25 @@ void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt
size_t pos = m_serviceType.find(";");
if (pos != kNotFound)
m_serviceType = m_serviceType.left(pos);
- if (renderer())
- setNeedsWidgetUpdate(true);
+ setNeedsWidgetUpdate(true);
+ // Per spec, only re-determine representation iff 'classid' and 'data' aren't present.
+ if (!fastHasAttribute(classidAttr) && !fastHasAttribute(dataAttr))
+ setNeedsStyleRecalc();
} else if (name == dataAttr) {
m_url = stripLeadingAndTrailingHTMLSpaces(value);
- if (renderer()) {
- setNeedsWidgetUpdate(true);
- if (isImageType()) {
- if (!m_imageLoader)
- m_imageLoader = adoptPtr(new HTMLImageLoader(this));
- m_imageLoader->updateFromElementIgnoringPreviousError();
- }
+ setNeedsWidgetUpdate(true);
+ if (renderer() && isImageType()) {
+ if (!m_imageLoader)
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
eseidel 2014/01/15 18:40:09 Lame that the original author didn't just add an e
+ m_imageLoader->updateFromElementIgnoringPreviousError();
+ } else if (!fastHasAttribute(classidAttr)) {
eseidel 2014/01/15 18:40:09 I don't understand this bit? Maybe we should abst
sof 2014/01/15 19:52:54 That's a good suggestion; now done (taking care no
+ setNeedsStyleRecalc();
}
} else if (name == classidAttr) {
m_classId = value;
- if (renderer())
- setNeedsWidgetUpdate(true);
+ setNeedsWidgetUpdate(true);
+ // Always re-determine representation upon 'classid' changing.
+ setNeedsStyleRecalc();
} else if (name == onbeforeloadAttr) {
setAttributeEventListener(EventTypeNames::beforeload, createAttributeEventListener(this, name, value));
} else {
« no previous file with comments | « LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698