Summary: | Subpixel layout: IntRect::infiniteRect() overflows when subpixel layout is enabled. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zalan <zalan> | ||||
Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, sam, simon.fraser, thorton | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 126283 | ||||||
Attachments: |
|
Description
zalan
2014-01-13 07:37:48 PST
overflow caused by IntRect::infiniteRect() (static IntRect infiniteRect(-std::numeric_limits<int>::max() / 2, -std::numeric_limits<int>::max() / 2, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); ) causes unexpected clipping -> missing content. This should help diff --git a/Source/WebCore/platform/graphics/IntRect.h b/Source/WebCore/platform/graphics/IntRect.h index 0a6d4aa..130fd83 100644 --- a/Source/WebCore/platform/graphics/IntRect.h +++ b/Source/WebCore/platform/graphics/IntRect.h @@ -27,6 +27,7 @@ #define IntRect_h #include "IntPoint.h" +#include "LayoutUnit.h" #include <wtf/Vector.h> #if USE(CG) @@ -236,7 +237,8 @@ inline bool operator!=(const IntRect& a, const IntRect& b) inline IntRect IntRect::infiniteRect() { - static IntRect infiniteRect(-std::numeric_limits<int>::max() / 2, -std::numeric_limits<int>::max() / 2, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); + static IntRect infiniteRect(-LayoutUnit::max() / 2, -LayoutUnit::max() / 2, LayoutUnit::max(), LayoutUnit::max()); return infiniteRect; } Oh, yes, one of the other ports noticed that we should do this (I didn't want to, but eventually became resigned to it) but closed their bug in a different way so I forgot about it. r+ if you post a patch. Created attachment 221555 [details]
Patch
Comment on attachment 221555 [details] Patch Clearing flags on attachment: 221555 Committed r162273: <http://trac.webkit.org/changeset/162273> All reviewed patches have been landed. Closing bug. This doesn't sit right with me (why should something called infiniteRect() have anything to do with LayoutUnits?) Can we at least add a comment explaining this weirdness? |