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

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

Issue 2376593003: Limit scope getter to predefined values (Closed)
Patch Set: Patch for landing Created 4 years, 2 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 return fastGetAttribute(headersAttr); 167 return fastGetAttribute(headersAttr);
168 } 168 }
169 169
170 void HTMLTableCellElement::setRowSpan(unsigned n) 170 void HTMLTableCellElement::setRowSpan(unsigned n)
171 { 171 {
172 setUnsignedIntegralAttribute(rowspanAttr, n); 172 setUnsignedIntegralAttribute(rowspanAttr, n);
173 } 173 }
174 174
175 const AtomicString& HTMLTableCellElement::scope() const 175 const AtomicString& HTMLTableCellElement::scope() const
176 { 176 {
177 return fastGetAttribute(scopeAttr); 177 const AtomicString& scopeValue = fastGetAttribute(scopeAttr);
178 if (equalIgnoringASCIICase(scopeValue, "row")) {
179 DEFINE_STATIC_LOCAL(const AtomicString, row, ("row"));
180 return row;
181 }
182 if (equalIgnoringASCIICase(scopeValue, "col")) {
183 DEFINE_STATIC_LOCAL(const AtomicString, col, ("col"));
184 return col;
185 }
186 if (equalIgnoringASCIICase(scopeValue, "rowgroup")) {
187 DEFINE_STATIC_LOCAL(const AtomicString, rowgroup, ("rowgroup"));
188 return rowgroup;
189 }
190 if (equalIgnoringASCIICase(scopeValue, "colgroup")) {
191 DEFINE_STATIC_LOCAL(const AtomicString, colgroup, ("colgroup"));
192 return colgroup;
193 }
194 return emptyAtom;
195 }
196
197 void HTMLTableCellElement::setScope(const AtomicString& value)
198 {
199 setAttribute(scopeAttr, value);
178 } 200 }
179 201
180 } // namespace blink 202 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698