Bug 126570

Summary: REGRESSION(r161381): [GTK] Rendering is broken in GTK after r161381
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abucur, changseok, commit-queue, esprehn+autocc, glenn, jinwoo7.song, kondapallykalyan, ryuan.choi, simon.fraser, thorton, WebkitBugTracker
Priority: P2 Keywords: Gtk, Regression
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch thorton: review+

Description Carlos Garcia Campos 2014-01-07 02:55:40 PST
Both GtkLauncher and MiniBrowser don't render anything after r161381. 

http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release/builds/43685/steps/layout-test
Comment 1 Carlos Garcia Campos 2014-01-07 06:46:47 PST
I think the problem has to do with the LayoutRect/IntRect conversion in RenderLayer.cpp. Using LayoutRect::infiniteRect() for the clips in RenderLayer.cpp fixes the problem.
Comment 2 Carlos Garcia Campos 2014-01-07 09:18:10 PST
Created attachment 220532 [details]
Patch

Using LayoutRect::infinteRect() instead of IntRect::infinteRect() when a LayoutRect is expected fixes the problem.
Comment 3 Andrei Bucur 2014-01-07 09:30:16 PST
This may not be related, but while working on the CSS Regions visual overflow patch we noticed the cairo based GraphicsContext was not able to clip using the infiniteRect(). It seems to cause an integer overflow in cairo and it clips using a completely wrong rectangle.

It's probably a good idea to make infiniteRect platform specific, based on the limitations of the underlying graphics library.
Comment 4 Carlos Garcia Campos 2014-01-07 09:38:25 PST
I don't know the details, but the Int/FloatRect::infiniteRect() is not defined the same way than the LayoutRect one, see:

LayoutRect:

LayoutUnit::nearlyMin() / 2, LayoutUnit::nearlyMin() / 2, LayoutUnit::nearlyMax(), LayoutUnit::nearlyMax()

which substituting nearlyMin/Max would be something like

(std::numeric_limits<int>::min() / 2) / 2, (std::numeric_limits<int>::min() / 2) / 2, std::numeric_limits<int>::max() / 2, std::numeric_limits<int>::max() / 2

IntRect:

-std::numeric_limits<int>::max() / 2, -std::numeric_limits<int>::max() / 2, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()
Comment 5 Tim Horton 2014-01-07 11:53:08 PST
Comment on attachment 220532 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220532&action=review

> Source/WebCore/ChangeLog:9
> +        Use LayoutRect::infiniteRect() instead of IntRect::infiniteRect()
> +        when a LayoutRect is expected.

Whoops :(
Comment 6 Carlos Garcia Campos 2014-01-07 11:57:44 PST
Committed r161443: <http://trac.webkit.org/changeset/161443>