New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 395838 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Compat



Sign in to add a comment

SVGSVGElement.viewport always returns [0,0,0,0]

Reported by dphilipd...@gmail.com, Jul 21 2014

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36

Example URL:
http://srufaculty.sru.edu/david.dailey/svg/balloon.svg

Steps to reproduce the problem:
1. http://srufaculty.sru.edu/david.dailey/svg/balloon.svg
2. 
3. 

What is the expected behavior?
Mountains should appear below the balloon. They do in Firefox. There should also be a radial gradient.

What went wrong?
Mountains and radial gradient do not appear

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? Yes From 2004 onward in most browsers that rendered SVG: ASV, Opera, FF, IE9, etc.

Does this work in other browsers? No IE 11 does IE 9 doesn't. Firefox doesn't. Chrome used to display properly.

Chrome version: 36.0.1985.125  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 14.0 r0

The example has been used in lots of demos and published books!
 
Labels: Cr-Blink-SVG

Comment 2 by f...@opera.com, Jul 22 2014

Labels: -OS-Windows OS-All
Looks like this has been broken in WebKit/Blink since 2012-01-20 (commit 8f9d4244912f43bb2103b61700cdf4f42c8dd146), when SVGSVGElement.viewport was changed to return an empty rectangle.
Using innerWidth/innerHeight instead (the catch(...)-branch in getDisplaySize) makes the mountains and gradient appear again (and is probably more interoperable - across browser implementations at least.)
Cc: matthewyuan@chromium.org
Status: Untriaged
I see similar behavior on previous stable channel i.e., 35.0.1916.153 and 34.0.1847.137.


Cc: pdr@chromium.org
Owner: f...@opera.com
Status: Assigned
@fs/pdr, can you ptal?

Comment 5 by f...@opera.com, Jul 23 2014

It'd seem that just removing the property would be the easiest "fix". Gecko for instance does not implement it at all (which I means the innerWidth/Height code-path will be taken in the TC - my FF-nightly seems to render ok.) Don't have IE close by, so can't test what it does (if it exposes the property or not.)

Comment 6 by e...@opera.com, Aug 7 2014

Summary: SVGSVGElement.viewport always returns [0,0,0,0] (was: SVG doc that used to work in Chrome no longer does)
I tried (without success) commenting out all but the catch segment of the code but still no success in Chrome. Still works in IE, old Opera, and Firefox just fine. Not sure what the above comment was actually recommending.

var extents = null;
   // try{
   //     var view = document.documentElement.viewport;
   //     extents = {width: view.width,height: view.height};
  //  }
  //  catch(e){
        extents = {width: window.innerWidth, height: window.innerHeight};
 //   }
    return extents;


Both of these pages have now been updated: 
http://srufaculty.sru.edu/david.dailey/svg/pattern.svg
and
http://srufaculty.sru.edu/david.dailey/svg/balloon.svg
with the simplified code. ed at opera showed me that the second one had another bug in the code which stopped it from working. Given that SVGSVGElement.viewport always returns [0,0,0,0]  (was: SVG doc that used to work in Chrome no longer does)  , the user/reporter (in this case, me) now considers this issue closed. 

Comment 9 by e...@opera.com, Aug 12 2014

I think we should remove the 'viewport' property from SVGSVGElement until it's implemented correctly. Mozilla argues that SVGSVGElement.viewport isn't speced in enough detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=503855.

IE11 supports it, seemingly returning whatever the x,y,width,height attributes on the svg root says as long as the values are simple absolute values, but it's buggy on nested <svg> and it doesn't resolve percentages at all (width=100% => viewport.width==0).

Comment 10 by f...@opera.com, Feb 6 2015

Attaching a TC that I constructed while trying to figure this out. Maybe it's of use to someone at some point (the behavior is pretty undefined though AFAIK...)
SVGSVGElement-viewport.html
1.7 KB View Download
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 16 2015

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9791cf9d8b005fc7cb8b589b099fcc33ba02ce2b

commit 9791cf9d8b005fc7cb8b589b099fcc33ba02ce2b
Author: davve <davve@opera.com>
Date: Wed Dec 16 11:19:55 2015

Measure SVGSVGElement.viewport

The implementation is trivial but entirely useless and has been since
2012. The attribute is not present at all in Gecko.

It has been removed from the spec:
http://www.w3.org/Graphics/SVG/WG/track/actions/3815

BUG= 395838 , 415074

Review URL: https://codereview.chromium.org/1523273002

Cr-Commit-Position: refs/heads/master@{#365515}

[modify] http://crrev.com/9791cf9d8b005fc7cb8b589b099fcc33ba02ce2b/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] http://crrev.com/9791cf9d8b005fc7cb8b589b099fcc33ba02ce2b/third_party/WebKit/Source/core/svg/SVGSVGElement.idl
[modify] http://crrev.com/9791cf9d8b005fc7cb8b589b099fcc33ba02ce2b/tools/metrics/histograms/histograms.xml

Project Member

Comment 12 by sheriffbot@chromium.org, Jul 8 2016

Labels: Hotlist-OpenBugWithCL
A change has landed for this issue, but it's been open for over 6 months. Please review and close it if applicable. If this issue should remain open, remove the "Hotlist-OpenBugWithCL" label. If no action is taken, it will be archived in 30 days.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 13 by f...@opera.com, Jul 8 2016

Labels: -Hotlist-OpenBugWithCL

Comment 14 by f...@opera.com, Jul 8 2016

Owner: ----
Status: Available (was: Assigned)
It is already removed from spec.
And blink always return empty rect. 
Time to deprecate this? 
Owner: shanmug...@samsung.com
Status: Assigned (was: Available)
Let me know if I need to do anything differently. I gather not, since the spec has changed?
Cc: foolip@chromium.org
SVGSVGElement.viewport removed from the spec.
https://github.com/w3c/svgwg/commit/99a342c09dc0f8f164667d45d1c8486f0f87af8f
Cc: f...@opera.com

Comment 22 by f...@opera.com, Aug 3 2016

@dphilipdailey: It looks like you've fixed up your example already, so you should be fine (at least in that particular example. Extracting the "right" dimensions in a different context may need additional tweaking of course.)
Project Member

Comment 24 by bugdroid1@chromium.org, Sep 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f742a3c284c19b78dbc337b641042a861e66d6b0

commit f742a3c284c19b78dbc337b641042a861e66d6b0
Author: shanmuga.m <shanmuga.m@samsung.com>
Date: Mon Sep 12 10:26:24 2016

Remove SVGSVGElement.viewport attribute

SVGSVGElement.viewport removed from the spec.
https://github.com/w3c/svgwg/commit/99a342c09dc0f8f164667d45d1c8486f0f87af8f

Intent to Remove:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/bFqDvZK2LVY

BUG= 395838 

Review-Url: https://codereview.chromium.org/2323653002
Cr-Commit-Position: refs/heads/master@{#417910}

[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/LayoutTests/svg/custom/detached-outermost-svg-crash-expected.txt
[delete] https://crrev.com/11c2346ed2ca5e97f8f019bee856d6ca07a3128a/third_party/WebKit/LayoutTests/svg/custom/immutable-properties-expected.png
[delete] https://crrev.com/11c2346ed2ca5e97f8f019bee856d6ca07a3128a/third_party/WebKit/LayoutTests/svg/custom/immutable-properties-expected.txt
[delete] https://crrev.com/11c2346ed2ca5e97f8f019bee856d6ca07a3128a/third_party/WebKit/LayoutTests/svg/custom/immutable-properties.html
[delete] https://crrev.com/11c2346ed2ca5e97f8f019bee856d6ca07a3128a/third_party/WebKit/LayoutTests/svg/custom/script-tests/immutable-properties.js
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/Source/core/svg/SVGSVGElement.h
[modify] https://crrev.com/f742a3c284c19b78dbc337b641042a861e66d6b0/third_party/WebKit/Source/core/svg/SVGSVGElement.idl

Status: Fixed (was: Assigned)

Sign in to add a comment