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

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 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
Index: Source/core/html/HTMLObjectElement.cpp
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index c2751ebf6bf50e2cbe22c5aa2434900cc588c65c..6bca4a6ac0c09bb46bc5931d20447481f5295451 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -98,8 +98,12 @@ 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())
+ if (renderer()) {
esprehn 2014/01/15 00:16:38 Blah, this isn't right, if the thing was display:
sof 2014/01/15 15:26:58 ok, I went ahead & did it here/now.
setNeedsWidgetUpdate(true);
+ // Per spec, only re-determine representation iff 'classid' and 'data' aren't present.
eseidel 2014/01/15 00:09:41 setNeedsWidgetUpdate is going to cause a recalc, n
esprehn 2014/01/15 00:16:38 no, it just sets a boolean, that whole system is b
+ if (inDocument() && !fastHasAttribute(classidAttr) && !fastHasAttribute(dataAttr))
esprehn 2014/01/15 00:16:38 You don't need the inDocument() check, setNeedsSty
sof 2014/01/15 15:26:58 Done.
+ setNeedsStyleRecalc();
+ }
} else if (name == dataAttr) {
m_url = stripLeadingAndTrailingHTMLSpaces(value);
if (renderer()) {
@@ -108,12 +112,18 @@ void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
+ } else if (inDocument() && !fastHasAttribute(classidAttr)) {
esprehn 2014/01/15 00:16:38 Same, don't check inDocument()
sof 2014/01/15 15:26:58 Done.
+ setNeedsStyleRecalc();
}
}
} else if (name == classidAttr) {
m_classId = value;
- if (renderer())
+ if (renderer()) {
setNeedsWidgetUpdate(true);
+ // Always re-determine representation upon 'classid' changing.
+ if (inDocument())
esprehn 2014/01/15 00:16:38 Remove inDocument()
sof 2014/01/15 15:26:58 Done.
+ setNeedsStyleRecalc();
+ }
} else if (name == onbeforeloadAttr) {
setAttributeEventListener(EventTypeNames::beforeload, createAttributeEventListener(this, name, value));
} else {

Powered by Google App Engine
This is Rietveld 408576698