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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLObjectElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void HTMLObjectElement::collectStyleForPresentationAttribute( 86 void HTMLObjectElement::collectStyleForPresentationAttribute(
87 const QualifiedName& name, 87 const QualifiedName& name,
88 const AtomicString& value, 88 const AtomicString& value,
89 MutableStylePropertySet* style) { 89 MutableStylePropertySet* style) {
90 if (name == borderAttr) 90 if (name == borderAttr)
91 applyBorderAttributeToStyle(value, style); 91 applyBorderAttributeToStyle(value, style);
92 else 92 else
93 HTMLPlugInElement::collectStyleForPresentationAttribute(name, value, style); 93 HTMLPlugInElement::collectStyleForPresentationAttribute(name, value, style);
94 } 94 }
95 95
96 void HTMLObjectElement::parseAttribute(const QualifiedName& name, 96 void HTMLObjectElement::parseAttribute(
97 const AtomicString& oldValue, 97 const AttributeModificationParams& params) {
98 const AtomicString& value) { 98 const QualifiedName& name = params.name;
99 if (name == formAttr) { 99 if (name == formAttr) {
100 formAttributeChanged(); 100 formAttributeChanged();
101 } else if (name == typeAttr) { 101 } else if (name == typeAttr) {
102 m_serviceType = value.lower(); 102 m_serviceType = params.newValue.lower();
103 size_t pos = m_serviceType.find(";"); 103 size_t pos = m_serviceType.find(";");
104 if (pos != kNotFound) 104 if (pos != kNotFound)
105 m_serviceType = m_serviceType.left(pos); 105 m_serviceType = m_serviceType.left(pos);
106 // TODO(schenney): crbug.com/572908 What is the right thing to do here? 106 // TODO(schenney): crbug.com/572908 What is the right thing to do here?
107 // Should we suppress the reload stuff when a persistable widget-type is 107 // Should we suppress the reload stuff when a persistable widget-type is
108 // specified? 108 // specified?
109 reloadPluginOnAttributeChange(name); 109 reloadPluginOnAttributeChange(name);
110 if (!layoutObject()) 110 if (!layoutObject())
111 requestPluginCreationWithoutLayoutObjectIfPossible(); 111 requestPluginCreationWithoutLayoutObjectIfPossible();
112 } else if (name == dataAttr) { 112 } else if (name == dataAttr) {
113 m_url = stripLeadingAndTrailingHTMLSpaces(value); 113 m_url = stripLeadingAndTrailingHTMLSpaces(params.newValue);
114 if (layoutObject() && isImageType()) { 114 if (layoutObject() && isImageType()) {
115 setNeedsWidgetUpdate(true); 115 setNeedsWidgetUpdate(true);
116 if (!m_imageLoader) 116 if (!m_imageLoader)
117 m_imageLoader = HTMLImageLoader::create(this); 117 m_imageLoader = HTMLImageLoader::create(this);
118 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousError); 118 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousError);
119 } else { 119 } else {
120 reloadPluginOnAttributeChange(name); 120 reloadPluginOnAttributeChange(name);
121 } 121 }
122 } else if (name == classidAttr) { 122 } else if (name == classidAttr) {
123 m_classId = value; 123 m_classId = params.newValue;
124 reloadPluginOnAttributeChange(name); 124 reloadPluginOnAttributeChange(name);
125 } else { 125 } else {
126 HTMLPlugInElement::parseAttribute(name, oldValue, value); 126 HTMLPlugInElement::parseAttribute(params);
127 } 127 }
128 } 128 }
129 129
130 static void mapDataParamToSrc(Vector<String>* paramNames, 130 static void mapDataParamToSrc(Vector<String>* paramNames,
131 Vector<String>* paramValues) { 131 Vector<String>* paramValues) {
132 // Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. 132 // Some plugins don't understand the "data" attribute of the OBJECT tag (i.e.
133 // Real and WMP require "src" attribute). 133 // Real and WMP require "src" attribute).
134 int srcIndex = -1, dataIndex = -1; 134 int srcIndex = -1, dataIndex = -1;
135 for (unsigned i = 0; i < paramNames->size(); ++i) { 135 for (unsigned i = 0; i < paramNames->size(); ++i) {
136 if (equalIgnoringCase((*paramNames)[i], "src")) 136 if (equalIgnoringCase((*paramNames)[i], "src"))
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 458
459 bool HTMLObjectElement::willUseFallbackContentAtLayout() const { 459 bool HTMLObjectElement::willUseFallbackContentAtLayout() const {
460 return !hasValidClassId() && hasFallbackContent(); 460 return !hasValidClassId() && hasFallbackContent();
461 } 461 }
462 462
463 void HTMLObjectElement::associateWith(HTMLFormElement* form) { 463 void HTMLObjectElement::associateWith(HTMLFormElement* form) {
464 associateByParser(form); 464 associateByParser(form);
465 }; 465 };
466 466
467 } // namespace blink 467 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLObjectElement.h ('k') | third_party/WebKit/Source/core/html/HTMLOptGroupElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698