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

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

Issue 2518163002: [css-tables] Fix divide-by-zero resulting from 32-bit overflow (Closed)
Patch Set: with layout test Created 4 years, 1 month 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/HTMLTableColElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
index 0199445ee167c78468dc07bb4870e39af52865a2..0d22d1d222310b9ebb7bdf4b6c070a07320dd26c 100644
--- a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
@@ -26,9 +26,11 @@
#include "core/CSSPropertyNames.h"
#include "core/HTMLNames.h"
+#include "core/html/HTMLTableCellElement.h"
#include "core/html/HTMLTableElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutTableCol.h"
+#include <algorithm>
namespace blink {
@@ -69,6 +71,8 @@ void HTMLTableColElement::parseAttribute(const QualifiedName& name,
// zero, set it to 1.
newSpan = 1;
}
+ newSpan = std::min(
dgrogan 2016/11/22 00:35:31 The real behavior change.
+ newSpan, static_cast<unsigned>(HTMLTableCellElement::kMaxColSpan));
m_span = newSpan;
if (layoutObject() && layoutObject()->isLayoutTableCol())
layoutObject()->updateFromElement();

Powered by Google App Engine
This is Rietveld 408576698