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

Unified Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 1903493003: Handle very large transforms in ContainerNode::boundingBox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index b52be5b0b3322af298044d2fe96b8f5e68c0870f..8099f739da783e31233d97e0eb49a6183b592a90 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -952,7 +952,11 @@ LayoutRect ContainerNode::boundingBox() const
upperLeft = lowerRight;
}
- return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));
+ FloatSize size = lowerRight.expandedTo(upperLeft) - upperLeft;
+ if (std::isnan(size.width()) || std::isnan(size.height()))
+ return LayoutRect();
+
+ return enclosingLayoutRect(FloatRect(upperLeft, size));
}
// This is used by FrameSelection to denote when the active-state of the page has changed
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698