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

Unified 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, 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..3c98ba5d6b7a03f5e58e61a6083936e9a0f017dc 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 (equalIgnoringASCIICase(scopeValue, "row")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, row, ("row"));
+ return row;
+ }
+ if (equalIgnoringASCIICase(scopeValue, "col")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, col, ("col"));
+ return col;
+ }
+ if (equalIgnoringASCIICase(scopeValue, "rowgroup")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, rowgroup, ("rowgroup"));
+ return rowgroup;
+ }
+ if (equalIgnoringASCIICase(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