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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLAreaElement.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 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // An explicit empty destructor should be in HTMLAreaElement.cpp, because 51 // An explicit empty destructor should be in HTMLAreaElement.cpp, because
52 // if an implicit destructor is used or an empty destructor is defined in 52 // if an implicit destructor is used or an empty destructor is defined in
53 // HTMLAreaElement.h, when including HTMLAreaElement.h, msvc tries to expand 53 // HTMLAreaElement.h, when including HTMLAreaElement.h, msvc tries to expand
54 // the destructor and causes a compile error because of lack of blink::Path 54 // the destructor and causes a compile error because of lack of blink::Path
55 // definition. 55 // definition.
56 HTMLAreaElement::~HTMLAreaElement() {} 56 HTMLAreaElement::~HTMLAreaElement() {}
57 57
58 DEFINE_NODE_FACTORY(HTMLAreaElement) 58 DEFINE_NODE_FACTORY(HTMLAreaElement)
59 59
60 void HTMLAreaElement::parseAttribute(const QualifiedName& name, 60 void HTMLAreaElement::parseAttribute(
61 const AtomicString& oldValue, 61 const AttributeModificationParams& params) {
62 const AtomicString& value) { 62 const AtomicString& value = params.newValue;
63 if (name == shapeAttr) { 63 if (params.name == shapeAttr) {
64 if (equalIgnoringASCIICase(value, "default")) { 64 if (equalIgnoringASCIICase(value, "default")) {
65 m_shape = Default; 65 m_shape = Default;
66 } else if (equalIgnoringASCIICase(value, "circle") || 66 } else if (equalIgnoringASCIICase(value, "circle") ||
67 equalIgnoringASCIICase(value, "circ")) { 67 equalIgnoringASCIICase(value, "circ")) {
68 m_shape = Circle; 68 m_shape = Circle;
69 } else if (equalIgnoringASCIICase(value, "polygon") || 69 } else if (equalIgnoringASCIICase(value, "polygon") ||
70 equalIgnoringASCIICase(value, "poly")) { 70 equalIgnoringASCIICase(value, "poly")) {
71 m_shape = Poly; 71 m_shape = Poly;
72 } else { 72 } else {
73 // The missing (and implicitly invalid) value default for the 73 // The missing (and implicitly invalid) value default for the
74 // 'shape' attribute is 'rect'. 74 // 'shape' attribute is 'rect'.
75 m_shape = Rect; 75 m_shape = Rect;
76 } 76 }
77 invalidateCachedPath(); 77 invalidateCachedPath();
78 } else if (name == coordsAttr) { 78 } else if (params.name == coordsAttr) {
79 m_coords = parseHTMLListOfFloatingPointNumbers(value.getString()); 79 m_coords = parseHTMLListOfFloatingPointNumbers(value.getString());
80 invalidateCachedPath(); 80 invalidateCachedPath();
81 } else if (name == altAttr || name == accesskeyAttr) { 81 } else if (params.name == altAttr || params.name == accesskeyAttr) {
82 // Do nothing. 82 // Do nothing.
83 } else { 83 } else {
84 HTMLAnchorElement::parseAttribute(name, oldValue, value); 84 HTMLAnchorElement::parseAttribute(params);
85 } 85 }
86 } 86 }
87 87
88 void HTMLAreaElement::invalidateCachedPath() { 88 void HTMLAreaElement::invalidateCachedPath() {
89 m_path = nullptr; 89 m_path = nullptr;
90 } 90 }
91 91
92 bool HTMLAreaElement::pointInArea(const LayoutPoint& location, 92 bool HTMLAreaElement::pointInArea(const LayoutPoint& location,
93 const LayoutObject* containerObject) const { 93 const LayoutObject* containerObject) const {
94 return getPath(containerObject).contains(FloatPoint(location)); 94 return getPath(containerObject).contains(FloatPoint(location));
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 SelectionBehaviorOnFocus selectionBehavior) { 224 SelectionBehaviorOnFocus selectionBehavior) {
225 document().updateStyleAndLayoutTreeForNode(this); 225 document().updateStyleAndLayoutTreeForNode(this);
226 if (!isFocusable()) 226 if (!isFocusable())
227 return; 227 return;
228 228
229 if (HTMLImageElement* imageElement = this->imageElement()) 229 if (HTMLImageElement* imageElement = this->imageElement())
230 imageElement->updateFocusAppearance(selectionBehavior); 230 imageElement->updateFocusAppearance(selectionBehavior);
231 } 231 }
232 232
233 } // namespace blink 233 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAreaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLBaseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698