[CSS Blending] Add tests using blending and isolation for body and html elements.
https://bugs.webkit.org/show_bug.cgi?id=132325

Patch by Ion Rosca <rosca@adobe.com> on 2014-05-05
Reviewed by Dirk Schulze.

* css3/compositing/blend-mode-body-child-background-color-expected.html: Added.
* css3/compositing/blend-mode-body-child-background-color.html: Added.
* css3/compositing/blend-mode-body-child-expected.html: Added.
* css3/compositing/blend-mode-body-child-isolate-background-color-expected.html: Added.
* css3/compositing/blend-mode-body-child-isolate-background-color.html: Added.
* css3/compositing/blend-mode-body-child-isolate-html-background-color-expected.html: Added.
* css3/compositing/blend-mode-body-child-isolate-html-background-color.html: Added.
* css3/compositing/blend-mode-body-child.html: Added.
* css3/compositing/blend-mode-body-element-expected.html: Added.
* css3/compositing/blend-mode-body-element.html: Added.
* css3/compositing/blend-mode-html-element-screen-expected.html: Added.
* css3/compositing/blend-mode-html-element-screen.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adapt inline SVG sizing behavior to Firefox and Blink
https://bugs.webkit.org/show_bug.cgi?id=132569

Reviewed by Dean Jackson.

Source/WebCore:
This patch is ported from Blink CR 308992. Thanks to David Vest for helping
with back porting his Blink patch. From the commit message:

"The basis of this change is to map explicit width and height
attributes to CSS properties, essentially promoting them to
presentation attributes. Note that implicit "100%" width and height
are not mapped.

This enables us to remove the concept of "percentage intrinsic size"
and rely on normal CSS rules to resolve percentage values.

The change has been approved by the SVG WG and the spec is being
updated. Minutes here:

http://www.w3.org/2014/04/07-svg-minutes.html#item03"

The new model was indeed approved by the SVG WG and is basically following
the CSS 2.1 model for replaced elements.

With this patch WebKit, Firefox and Blink have the same behavior for inline SVG.
This is the first successful approach to unify the sizing behavior of SVG
across UAs.

Tests: svg/as-object/sizing/svg-in-object-placeholder-height-auto.html
       svg/as-object/sizing/svg-in-object-placeholder-height-fixed.html
       svg/as-object/sizing/svg-in-object-placeholder-height-percentage.html
       svg/in-html/sizing/svg-inline.html

* css/svg.css: Root SVG elements still need to be sized with height: 100% and
    width: 100%. This is necessary since width and height are presentation
    attributes now.
(svg:root):
* rendering/RenderBox.h:
(WebCore::RenderBox::computeIntrinsicRatioInformation): Remove all special
    behavior for intrinsic and percentage based sizes in SVG. This simplifies and
    unifies the code a lot. Most of the logic that is used is in RenderBox and
    RenderReplaced now. RenderSVGRoot was cleaned up a lot and is much lighter.
    And so it SVGSVGElement.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
(WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::computeIntrinsicRatioInformation):
* rendering/RenderImage.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
(WebCore::RenderReplaced::computeIntrinsicRatioInformation):
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
(WebCore::RenderReplaced::computePreferredLogicalWidths):
* rendering/RenderReplaced.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeIntrinsicRatioInformation):
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
(WebCore::RenderSVGRoot::hasRelativeDimensions):
(WebCore::RenderSVGRoot::hasRelativeIntrinsicLogicalWidth): Deleted.
(WebCore::RenderSVGRoot::hasRelativeLogicalHeight): Deleted.
* rendering/svg/RenderSVGRoot.h:
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::isPresentationAttribute):
(WebCore::SVGSVGElement::collectStyleForPresentationAttribute):
(WebCore::SVGSVGElement::svgAttributeChanged):
(WebCore::SVGSVGElement::currentViewportSize):
(WebCore::SVGSVGElement::hasIntrinsicWidth):
(WebCore::SVGSVGElement::hasIntrinsicHeight):
(WebCore::SVGSVGElement::intrinsicWidth):
(WebCore::SVGSVGElement::intrinsicHeight):
(WebCore::SVGSVGElement::widthAttributeEstablishesViewport): Deleted.
(WebCore::SVGSVGElement::heightAttributeEstablishesViewport): Deleted.
* svg/SVGSVGElement.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::containerSize):
* xml/XMLErrors.cpp: If an error occurs in a stand alone SVG file, we create
    an XHTML document with the error message and append the SVG file.
    This SVG file now follows the CSS sizing behavior as inline SVG.
    Therefore, we need to set width and height to 100% explicitly.
(WebCore::XMLErrors::insertErrorMessageBlock):

LayoutTests:
The new sizing behavior for inline SVG causes different DRT outputs for about 40 test cases.
This is expected but for most tests an improvement since the SVGs fit into the documents
and scrollbars disappear or the general size gets smaller.
Some tests needed to be updated. The size was either not set at all or not properly.

svg-in-object.js and svg-inline.js contain dozens of new tests to check the correct sizing
behavior.

The tests were written by David Vest from Opera as part of CR 308992.

Many of the -expected updates are caused by SVG size changes in turn
affecting where line breaks are inserted.

* TestExpectations:
* accessibility/svg-image-expected.txt:
* css3/flexbox/flexitem.html:
* fast/css/infinite-floating-value-expected.txt:
* fast/css/remove-fixed-resizer-crash-expected.txt:
* fast/css3-text/css3-word-spacing-percentage/word-spacing-crash-expected.txt:
* fast/repaint/moving-shadow-on-container.html:
* fast/repaint/moving-shadow-on-path.html:
* fast/repaint/svg-layout-root-style-attr-update.html:
* fast/shapes/shape-outside-floats/shape-outside-relative-size-svg-expected.html:
* fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html:
* http/tests/xmlviewer/dumpAsText/svg-expected.txt:
* platform/mac/svg/batik/filters/feTile-expected.txt:
* platform/mac/svg/batik/masking/maskRegions-expected.txt:
* platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt:
* platform/mac/svg/batik/text/longTextOnPath-expected.txt:
* platform/mac/svg/batik/text/textDecoration-expected.txt:
* platform/mac/svg/batik/text/textEffect-expected.txt:
* platform/mac/svg/batik/text/textLength-expected.txt:
* platform/mac/svg/batik/text/textOnPath-expected.txt:
* platform/mac/svg/batik/text/textPosition-expected.txt:
* platform/mac/svg/batik/text/verticalText-expected.txt:
* platform/mac/svg/batik/text/verticalTextOnPath-expected.txt:
* platform/mac/svg/custom/bug45331-expected.txt:
* platform/mac/svg/custom/junk-data-expected.txt:
* platform/mac/svg/custom/missing-xlink-expected.txt:
* platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.png: Removed.
* platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.txt: Removed.
* platform/mac/svg/custom/path-bad-data-expected.txt:
* platform/mac/svg/custom/svg-fonts-in-html-expected.txt:
* platform/mac/svg/custom/use-font-face-crash-expected.txt:
* platform/mac/svg/foreignObject/svg-document-in-html-document-expected.txt:
* platform/mac/svg/hixie/error/012-expected.txt:
* platform/mac/svg/hixie/intrinsic/001-expected.png: Removed.
* platform/mac/svg/hixie/intrinsic/001-expected.txt: Removed.
* platform/mac/svg/hixie/intrinsic/002-expected.png: Removed.
* platform/mac/svg/hixie/intrinsic/002-expected.txt: Removed.
* platform/mac/svg/in-html/circle-expected.txt:
* platform/mac/svg/text/non-bmp-positioning-lists-expected.txt:
* platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.txt:
* platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.txt:
* platform/mac/svg/wicd/rightsizing-grid-expected.txt:
* platform/mac/svg/wicd/test-rightsizing-b-expected.txt:
* platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt:
* platform/mac/svg/zoom/page/zoom-background-images-expected.txt:
* platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt:
* platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt:
* platform/mac/svg/zoom/text/zoom-foreignObject-expected.txt:
* svg/animations/animate-css-xml-attributeType-expected.txt:
* svg/as-image/image-respects-deviceScaleFactor.html:
* svg/as-image/image-respects-pageScaleFactor.html:
* svg/as-image/svg-as-image-with-relative-size-expected.html:
* svg/as-image/svg-as-relative-image.html:
* svg/as-object/sizing/svg-in-object-placeholder-height-auto-expected.txt: Added.
* svg/as-object/sizing/svg-in-object-placeholder-height-auto.html: Added.
* svg/as-object/sizing/svg-in-object-placeholder-height-fixed-expected.txt: Added.
* svg/as-object/sizing/svg-in-object-placeholder-height-fixed.html: Added.
* svg/as-object/sizing/svg-in-object-placeholder-height-percentage-expected.txt: Added.
* svg/as-object/sizing/svg-in-object-placeholder-height-percentage.html: Added.
* svg/as-object/sizing/svg-in-object.js: Added.
(.):
(.addAttr):
(.generateSVGURI):
(buildDemo):
(.doCombinationTestRecursive):
(doCombinationTest):
(debugHint):
(.debugHint):
(testSVGInObjectWithPlaceholderHeightAttr.):
(testSVGInObjectWithPlaceholderHeightAttr):
* svg/css/composite-shadow-example.html:
* svg/css/composite-shadow-with-opacity.html:
* svg/css/max-width-2.html:
* svg/css/stars-with-shadow.html:
* svg/custom/absolute-sized-content-with-resources.xhtml:
* svg/custom/altglyph.svg:
* svg/custom/document-all-includes-svg-expected.txt:
* svg/custom/external-paintserver-reference-expected.txt:
* svg/custom/external-paintserver-reference.svg:
* svg/custom/get-text-element-transform-crash-expected.txt:
* svg/custom/linking-base-external-reference-expected.txt:
* svg/custom/linking-base-external-reference.xhtml:
* svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.txt: Removed.
* svg/custom/object-sizing-height-50p-on-target-svg-absolute.xhtml: Removed.
* svg/custom/object-sizing-height-50p-on-target-svg-expected.txt: Removed.
* svg/custom/object-sizing-height-50p-on-target-svg.xhtml: Removed.
* svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute.xhtml: Removed.
* svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-height-50p-on-target-svg.xhtml: Removed.
* svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute.xhtml: Removed.
* svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-height-75p-on-target-svg.xhtml: Removed.
* svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-on-target-svg-absolute.xhtml: Removed.
* svg/custom/object-sizing-width-50p-on-target-svg-expected.txt: Removed.
* svg/custom/object-sizing-width-50p-on-target-svg.xhtml: Removed.
* svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.txt: Removed.
* svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute.xhtml: Removed.
* svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.txt: Removed.
* svg/custom/object-sizing-width-75p-height-50p-on-target-svg.xhtml: Removed.
* svg/custom/pending-resource-after-removal.xhtml:
* svg/custom/percentage-of-html-parent.xhtml:
* svg/custom/relative-sized-content-with-resources.xhtml:
* svg/custom/relative-sized-content.xhtml:
* svg/custom/relative-sized-deep-shadow-tree-content.xhtml:
* svg/custom/relative-sized-image.xhtml:
* svg/custom/relative-sized-inner-svg.xhtml:
* svg/custom/relative-sized-shadow-tree-content-with-symbol.xhtml:
* svg/custom/relative-sized-shadow-tree-content.xhtml:
* svg/custom/relative-sized-use-on-symbol.xhtml:
* svg/custom/relative-sized-use-without-attributes-on-symbol.xhtml:
* svg/custom/tref-with-progress-tag-setpseudo-assert-expected.txt:
* svg/custom/unicode-in-tspan-multi-svg-crash-expected.txt:
* svg/custom/use-invalid-html-expected.txt:
* svg/custom/window-named-item-lookup-expected.txt:
* svg/dom/SVGViewSpec-invalid-ref-crash-expected.txt:
* svg/dom/parent-view-layout-crash-expected.txt:
* svg/dom/stylesheet-candidate-node-crash-main-expected.txt:
* svg/dom/svg-root-lengths.html:
* svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt:
* svg/hixie/intrinsic/001-expected.png: Removed.
* svg/hixie/intrinsic/001-expected.txt: Removed.
* svg/hixie/intrinsic/001.html: Removed.
* svg/hixie/intrinsic/002-expected.png: Removed.
* svg/hixie/intrinsic/002-expected.txt: Removed.
* svg/hixie/intrinsic/002.html: Removed.
* svg/hixie/intrinsic/resources/001.svg: Removed.
* svg/hixie/intrinsic/resources/002.svg: Removed.
* svg/in-html/sizing/svg-inline-expected.txt: Added.
* svg/in-html/sizing/svg-inline.html: Added.
* svg/in-html/sizing/svg-inline.js: Added.
(.):
(setupSVGElement):
(buildDemo):
(.doCombinationTestRecursive):
(doCombinationTest):
(debugHint):
(.debugHint):
* svg/path-arc-invalid-expected.txt:
* svg/repaint/repaint-webkit-svg-shadow-container-expected.txt:
* svg/text/append-text-node-to-tspan.html:
* svg/text/kerning.svg:
* svg/text/modify-text-node-in-tspan.html:
* svg/text/multichar-glyph.svg:
* svg/text/remove-text-node-from-tspan.html:
* svg/text/remove-tspan-from-text.html:
* svg/text/svg-rtl-text-crash-expected.txt:
* svg/text/text-block-child-crash-expected.txt:
* svg/transforms/animated-path-inside-transformed-html.xhtml:
* svg/transforms/svg-css-transforms-clip-path.xhtml:
* svg/transforms/transform-origin-css-property.xhtml:
* svg/zoom/page/zoom-foreignObject.svg:
* svg/zoom/page/zoom-svg-as-relative-image.html:
* svg/zoom/text/zoom-foreignObject.svg:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Soup] Use std::unique_ptr<char[]> for the read buffer in SocketStreamHandle
https://bugs.webkit.org/show_bug.cgi?id=132559

Reviewed by Carlos Garcia Campos.

Manage the read buffer array through a std::unique_ptr<char[]> object.
This avoids handling with the raw pointer and also ensures that the memory
allocated with the new[] operator is deleted with the delete[] operator,
a problem exposed by the AddressSanitizer in WebSocket tests.

* platform/network/soup/SocketStreamHandle.h:
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::connected):
(WebCore::SocketStreamHandle::readBytes):
(WebCore::SocketStreamHandle::platformClose):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Share mac/editing/spelling/delete-into-misspelled-word.html with other platforms
https://bugs.webkit.org/show_bug.cgi?id=132561

Reviewed by Darin Adler.

This test does not use Mac specific features and
can be run by other platforms as well.

Due to bug 125689, this test starts using asynchronous spellchecking.

* editing/spelling/delete-into-misspelled-word-expected.txt:
Renamed from LayoutTests/platform/mac/editing/spelling/delete-into-misspelled-word-expected.txt
* editing/spelling/delete-into-misspelled-word.html:
Renamed from LayoutTests/platform/mac/editing/spelling/delete-into-misspelled-word.html

* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
Mark delete-into-misspelled-word.html as failing since those
platforms didn't turn on asynchronous spellchecking.


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