Boxes with rounded corners and thin borders are too slow to draw
https://bugs.webkit.org/show_bug.cgi?id=101974

Reviewed by Simon Fraser.

Source/WebCore:

With the current implementation RenderBox::
determineBackgroundBleedAvoidance() uses the slow path
BackgroundBleedUseTransparencyLayer for some very common use cases,
notably for drawing rectangles with rounded corners that have thin
borders. This is because the BackgroundBleedShrinkBackground
strategy requires a border at least two pixels wide on all sides. This
patch introduce drawing strategy BackgroundBleedBackgroundOverBorder.
This approach consists in drawing the border first, with an inset inner
edge (for anti-aliased compositing to work well).  This approach only
works with opaque solid edges and opaque single-layer backgrounds.
By using this approach rather than BackgroundBleedUseTransparencyLayer,
we save two clipPath, one save and one saveLayer on the
GraphicsContext. This patch gets good coverage from existing layout
tests. One additional test was added to exercise mitring, thick edges
and anti-aliasing edge cases under the new painting algorithm.

Test: fast/borders/border-radius-wide-border-05.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::determineBackgroundBleedAvoidance):
Added selection criteria for BackgroundOverBorder
(WebCore::RenderBox::paintBoxDecorations):
Added a preliminary paintBorder pass for BackgroundOverBorder
(WebCore::RenderBox::paintBackground):
Insetting the background to to innerBorder when bleedAvoidance is
BackgroundOverBorder.  This why BackgroundOverBorder only works for
Opaque solid edges.
(WebCore):
(WebCore::RenderBox::backgroundIsSingleOpaqueLayer):
Utility method use by determineBackgroundBleedAvoidance to test the
background's eligibility for BackgroundOverBorder bleed avoidance
strategy.  The reason the background must be a single layer is to avoid
color bleeding from layer compositing along anti-aliased edges
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::getBackgroundRoundedRect):
(WebCore::RenderBoxModelObject::borderInnerRectAdjustedForBleedAvoidance):
Added support for BackgroundOverBorder by applying a one pixel inset.
(WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance):
Set the background rect to the inner border for BackgroundOverBorder
(WebCore):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
Added support for BackgroundOverBorder by using
backgroundRoundedRectAdjustedForBleedAvoidance
(WebCore::RenderBoxModelObject::paintBorderSides):
Added support for BackgroundOverBorder by applying per-side inset
adjustments.
(WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
(WebCore::RenderBoxModelObject::paintBorder):
Added support for BackgroundOverBorder by using an adjusted inner
border, but not if sides are painted individually.
* rendering/RenderBoxModelObject.h:
(RenderBoxModelObject):

LayoutTests:

New test that purposely triggers the BackgroundOverBorder painting path
in WebCore::RenderBox, to test it with thick borders, off-diagonal
mitring, an anti-aliased rounded border wedge, and a border of width 0.

* fast/borders/border-radius-wide-border-05.html: Added.
* fast/borders/border-radius-wide-border-05-expected.txt: Added.
* LayoutTests/platform/chromium-win/fast/borders/border-radius-wide-border-05-expected.png: Added.
* LayoutTests/platform/chromium/TestExpectations: Added Expectations.
Added expectations for tests pixels results that require rebaselining


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add DOMRequestState to maintain world/ScriptExecutionContext state
https://bugs.webkit.org/show_bug.cgi?id=102102

Reviewed by Adam Barth.

Introduce DOMRequestState, and convert IndexedDB over.

No new tests, this is an abstraction layer for existing code.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::dispatchEvent):
* Modules/indexeddb/IDBRequest.h:
(IDBRequest):
* WebCore.gypi:
* bindings/v8/DOMRequestState.h: Added.
(WebCore):
(DOMRequestState):
(WebCore::DOMRequestState::DOMRequestState):
(Scope):
(WebCore::DOMRequestState::Scope::Scope):
(WebCore::DOMRequestState::scope):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134632 268f45cc-cd09-0410-ab3c-d52691b4dbfc