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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp

Issue 2376593003: Limit scope getter to predefined values (Closed)
Patch Set: V2 Created 4 years, 3 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: third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp
index 26553e6f9bcc05a40c50c723c3a041f695542430..58d6ae5e589aa7ff66aef7c9910963dbba00cf13 100644
--- a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp
@@ -174,7 +174,29 @@ void HTMLTableCellElement::setRowSpan(unsigned n)
const AtomicString& HTMLTableCellElement::scope() const
{
- return fastGetAttribute(scopeAttr);
+ const AtomicString& scopeValue = fastGetAttribute(scopeAttr);
+ if (equalIgnoringCase(scopeValue, "row")) {
tkent 2016/09/28 00:23:08 equalIgnoringCase should be equalIgnoringASCIICase
rwlbuis 2016/09/28 13:43:12 Done :)
+ DEFINE_STATIC_LOCAL(const AtomicString, row, ("row"));
+ return row;
+ }
+ if (equalIgnoringCase(scopeValue, "col")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, col, ("col"));
+ return col;
+ }
+ if (equalIgnoringCase(scopeValue, "rowgroup")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, rowgroup, ("rowgroup"));
+ return rowgroup;
+ }
+ if (equalIgnoringCase(scopeValue, "colgroup")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, colgroup, ("colgroup"));
+ return colgroup;
+ }
+ return emptyAtom;
+}
+
+void HTMLTableCellElement::setScope(const AtomicString& value)
+{
+ setAttribute(scopeAttr, value);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698