Fixed-position foreignObject descendants should be relative to the foreignObject...
authorfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jun 2012 19:37:07 +0000 (19:37 +0000)
committerfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jun 2012 19:37:07 +0000 (19:37 +0000)
commitf4ad12a13ff10d851ecba8e245e767f5cc7d2188
tree2069e2120ef18fb12dd0befc886edaf2f24d2783
parenta9c4c40bcff6ba8e8f82029b2f3c92c086d1976a
Fixed-position foreignObject descendants should be relative to the foreignObject viewport
https://bugs.webkit.org/show_bug.cgi?id=88547

Reviewed by Abhishek Arya.

Source/WebCore:

Tests: svg/foreignObject/fO-fixed-position-crash.html
       svg/foreignObject/fixed-position-expected.svg
       svg/foreignObject/fixed-position.svg

Fixed position elements are currently registered with the top level
RenderView even when embedded within an SVG foreignOject. This patch
changes containingBlock() & container() to return the containing
foreignObject renderer instead.

The new foreignObject fixed position behavior matches that of current
FireFox and Opera versions and is consistent with the spec:
http://www.w3.org/TR/CSS2/visuren.html#fixed-positioning
http://www.w3.org/TR/SVG/coords.html#EstablishingANewViewport

* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock):
(WebCore::RenderObject::container):

LayoutTests:

* svg/foreignObject/fO-fixed-position-crash-expected.txt: Added.
* svg/foreignObject/fO-fixed-position-crash.html: Added.
* svg/foreignObject/fixed-position-expected.svg: Added.
* svg/foreignObject/fixed-position.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt [new file with mode: 0644]
LayoutTests/svg/foreignObject/fO-fixed-position-crash.html [new file with mode: 0644]
LayoutTests/svg/foreignObject/fixed-position-expected.svg [new file with mode: 0644]
LayoutTests/svg/foreignObject/fixed-position.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp