Changeset 94074 in webkit
- Timestamp:
- Aug 30, 2011, 6:16:38 AM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLImageElement.cpp (modified) (3 diffs)
-
html/HTMLImageElement.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r94068 r94074 1 2011-08-30 Andreas Kling <kling@webkit.org> 2 3 HTMLImageElement: Don't cache "ismap" and "usemap" attributes. 4 https://bugs.webkit.org/show_bug.cgi?id=66784 5 6 Reviewed by Darin Adler. 7 8 * html/HTMLImageElement.h: Remove the "ismap" and "usemap" members, 9 shrinking HTMLImageElement by 16 bytes (on 64-bit.) 10 * html/HTMLImageElement.cpp: 11 (WebCore::HTMLImageElement::HTMLImageElement): 12 (WebCore::HTMLImageElement::parseMappedAttribute): Most of the logic 13 for "ismap" and "usemap" moved into isServerMap(). 14 (WebCore::HTMLImageElement::isServerMap): Out-of-lined and implemented 15 using fast*Attribute(). 16 1 17 2011-08-30 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r92118 r94074 45 45 : HTMLElement(tagName, document) 46 46 , m_imageLoader(this) 47 , ismap(false)48 47 , m_form(form) 49 48 , m_compositeOperator(CompositeSourceOver) … … 128 127 else if (attrName == valignAttr) 129 128 addCSSProperty(attr, CSSPropertyVerticalAlign, attr->value()); 130 else if (attrName == usemapAttr) { 131 if (attr->value().string()[0] == '#') 132 usemap = attr->value(); 133 else 134 usemap = document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attr->value())).string(); 129 else if (attrName == usemapAttr) 135 130 setIsLink(!attr->isNull()); 136 } else if (attrName == ismapAttr)137 ismap = true;138 131 else if (attrName == onabortAttr) 139 132 setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attr)); … … 401 394 } 402 395 403 } 396 bool HTMLImageElement::isServerMap() const 397 { 398 if (!fastHasAttribute(ismapAttr)) 399 return false; 400 401 const AtomicString& usemap = fastGetAttribute(usemapAttr); 402 403 // If the usemap attribute starts with '#', it refers to a map element in the document. 404 if (usemap.string()[0] == '#') 405 return false; 406 407 return document()->completeURL(stripLeadingAndTrailingHTMLSpaces(usemap)).isEmpty(); 408 } 409 410 } -
trunk/Source/WebCore/html/HTMLImageElement.h
r91404 r94074 48 48 int naturalHeight() const; 49 49 50 bool isServerMap() const { return ismap && usemap.isEmpty(); }50 bool isServerMap() const; 51 51 52 52 String altText() const; … … 104 104 105 105 HTMLImageLoader m_imageLoader; 106 String usemap;107 bool ismap;108 106 HTMLFormElement* m_form; 109 107 AtomicString m_name;
Note:
See TracChangeset
for help on using the changeset viewer.