SVG: <altglpyh> for a surrogate pair character in a ligature fails
https://bugs.webkit.org/show_bug.cgi?id=102969

Reviewed by Dirk Schulze.

Source/WebCore:

There are two issues with SVG <altglyph> tags applied to surrogate
fonts, particularly when mixed with non-standard forms (arabic,
vertical, etc.).

First, there is an assertion that is invalid when an alt glyph is
substituted for the surrogate, because the text chunk that is consumed
by an alt glyph is the entire run, whereas we assert that a
surrogate's chunk is length 2 regardless. That assertion has been
removed.

Second, when an arabic character or some other characters requiring a
special form appears before the surrogate pair character inside the alt
glyph tag, we reject the alt glyph because it is not compatible with the form.
However, when we process the next character - the surrogate pair - we
do accept the alt glyph. This breaks all the indexes because we have
already consumed part of the run that is now considered the alt glyph.
Chaos ensues. This patch forces us to always accept alt glyph
characters (assuming we have some glyph to draw). This better matches
the intent of the spec - if someone specifies an alt glyph they are
explicitly stating which glyph they want used. We should not argue
with the content author.

Tests: svg/text/alt-glyph-for-surrogate-pair-expected.svg
       svg/text/alt-glyph-for-surrogate-pair.svg

* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Fix some poor code.
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::advanceSimpleText): Remove an assert that is not always valid.
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection): Always return an altGlyph when found. Do not check it compatibility.

LayoutTests:

Test and reference result for altGlyph elements applied to a surrogate pair
following an arabic form. Note that these tests are html, but for the test to fail
without the patch they must be parsed as svg (xml).

* svg/text/alt-glyph-for-surrogate-pair-expected.svg: Added.
* svg/text/alt-glyph-for-surrogate-pair.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderBlock hit testing should ignore PseudoElements
https://bugs.webkit.org/show_bug.cgi?id=105545

Reviewed by Eric Seidel.

Source/WebCore:

Use nonPseudoNode() in hit testing code in RenderBlock and RenderBox so
that when clicking on the box generated by a pseudo element we never
generate a Position for the PseudoElement, but instead for the
generating node.

Test: fast/css-generated-content/block-and-box-hit-testing.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForBox):
(WebCore::isEditingBoundary):
(WebCore::positionForPointRespectingEditingBoundaries):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionForPoint):

LayoutTests:

Add test for hit testing on pseudo element generated blocks and boxes.

* fast/css-generated-content/block-and-box-hit-testing-expected.txt: Added.
* fast/css-generated-content/block-and-box-hit-testing.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a crash test expectation on Mac. ap is looking into the problem as we speak.

* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) to USE(NETWORK_CFDATA_ARRAY_CALLBACK)
https://bugs.webkit.org/show_bug.cgi?id=105578

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* loader/ResourceBuffer.cpp: Remove duplicate append() call that was under the wrong ifdef.
* loader/ResourceBuffer.h:

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/NetworkResourceLoader.h:

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