The threaded HTML parser should pass all the fast/parser tests
https://bugs.webkit.org/show_bug.cgi?id=109486

Reviewed by Tony Gentilcore.

Source/WebCore:

This patch fixes the last two test failures in fast/parser, which were
crashes caused by not having a tokenizer when document.close() was
called. (The tokenizer is created lazily by calls to document.write,
which might not happen before document.close).

fast/parser/document-close-iframe-load.html
fast/parser/document-close-nested-iframe-load.html

In addition, I've added a new test to make sure we flush the tokenizer
properly in these cases.

Test: fast/parser/document-close-iframe-load-partial-entity.html

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::prepareToStopParsing):
(WebCore::HTMLDocumentParser::pumpTokenizer):

LayoutTests:

* fast/parser/document-close-iframe-load-partial-entity-expected.txt: Added.
* fast/parser/document-close-iframe-load-partial-entity.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FrameView::setScrollPosition should clamp scroll position before handing it to
ScrollingCoordinator instead of depending on ScrollView to do this
https://bugs.webkit.org/show_bug.cgi?id=109497
<rdar://problem/12631789>

Reviewed by Simon Fraser.

Clamp scroll position before handing it to ScrollingCoordinator. Also, like ScrollView does,
bail out if we've already scrolled to the clamped scroll position.

Test: platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls.html

* page/FrameView.cpp:
(WebCore::FrameView::setScrollPosition):

Adjust some test results which previously expected out-of-bounds scrolling to happen.

Add a test that ensures that out-of-bounds scrolling doesn't happen.

* platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls.html: Added.
* platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Handle shape-outside changing a float's overhang behavior
https://bugs.webkit.org/show_bug.cgi?id=106927

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2013-02-11
Reviewed by Julien Chaffraix.

Source/WebCore:

When the position on a shape outside causes a float to spill out into
another block than it's container, it was not being drawn correctly. It
became apparent that in order to fix this properly, the approach to
positioning shape outsides and floats needed to be changed. The new
approach also fixes some other outstanding issues, like hit detection.

When a float has a shape outside, inline and float layout happens
using the exclusion shape bounds instead of the float's box.  The
effect of this is that the float itself no longer has any effect on
layout, both with respect to positioning of the float's siblings as
well as positioning the float's box. This means that when the float is
positioned, it is the shape's box that must obey the positioning rules
for floats. When the shape is given a position relative to the float's
box, the rules for float positioning determine where the shape sits
in the parent, causing the float's box to be offset by the position of
the shape. Since the float's box does not affect layout (due to the
shape), this is similar to relative positioning in that the offset is
a paint time occurrence.

So the new approach is to implement positioning of shape outside on
floats similar to how relative positioning is implemented, using a
RenderLayer.

This is also tested by the existing tests for shape outside on floats positioning.

Test: fast/exclusions/shape-outside-floats/shape-outside-floats-overhang.html

* rendering/ExclusionShapeOutsideInfo.h:
(WebCore::ExclusionShapeOutsideInfo::shapeLogicalOffset): Utility method to create a LayoutSize for computing the layer offset.
(ExclusionShapeOutsideInfo):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState): Check for floats with shape outside as well as in flow positioning.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::flipFloatForWritingModeForChild): Remove old positioning implementation.
(WebCore::RenderBlock::paintFloats): Remove old positioning implementation.
(WebCore::RenderBlock::blockSelectionGaps): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderBlock::positionNewFloats): Remove old positioning implementation.
(WebCore::RenderBlock::addOverhangingFloats): Remove FIXME.
(WebCore::positionForPointRespectingEditingBoundaries): Check for floats with shape outside as well as in flow positioning.
* rendering/RenderBlock.h:
(RenderBlock): Remove old positioning implementation.
(WebCore::RenderBlock::xPositionForFloatIncludingMargin): Remove old positioning implementation.
(WebCore::RenderBlock::yPositionForFloatIncludingMargin): Remove old positioning implementation.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderBox::offsetFromContainer): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderBox::computeRectForRepaint): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderBox::layoutOverflowRectForPropagation): Check for floats with shape outside as well as in flow positioning.
* rendering/RenderBox.h: Make floats with shape outside get a layer.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintOffset): Method to return in flow
    positioning offset + offset from shape outside on floats.
* rendering/RenderBoxModelObject.h:
(RenderBoxModelObject): Add paintOffset method.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderInline::computeRectForRepaint): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderInline::mapLocalToContainer): Check for floats with shape outside as well as in flow positioning.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition): Check for floats with shape outside as well as in flow positioning.
(WebCore::RenderLayer::calculateClipRects): Check for floats with shape outside as well as in flow positioning.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::paintOffset): Rename offsetForInFlowPosition to reflect that it's not just for
    in flow positioning, it also reflects shape outside position on floats.
(RenderLayer):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasPaintOffset): Determines if this object is in flow positioined or is a float with shape outside.
* rendering/style/RenderStyle.h: Add hasPaintOffset method, analagous to method with same name on RenderObject.

LayoutTests:

This is also tested by the existing tests for shape outside on floats positioning.

* fast/exclusions/shape-outside-floats/shape-outside-floats-overhang-expected.html: Added.
* fast/exclusions/shape-outside-floats/shape-outside-floats-overhang.html: Added.

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