<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>81208</bug_id>
          
          <creation_ts>2012-03-15 04:26:32 -0700</creation_ts>
          <short_desc>innerHeight and Width returns wrong values when scaled and having non-overlay scrollbars</short_desc>
          <delta_ts>2012-03-15 10:32:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>81209</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Kenneth Rohde Christiansen">kenneth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>skyostil</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>579270</commentid>
    <comment_count>0</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-03-15 04:26:32 -0700</bug_when>
    <thetext>1136     long height = view-&gt;visibleContentRect(/* includeScrollbars */ true).height();
1137     InspectorInstrumentation::applyScreenHeightOverride(m_frame, &amp;height);
1138     return static_cast&lt;int&gt;(height / (m_frame-&gt;pageZoomFactor() * m_frame-&gt;frameScaleFactor()));

Calculating back doesn&apos;t work in the case there is a scrollbar actually taking up space.

Example

viewport is 110 (100 pixels css contents, 10 pixels scrollbar)

content is scaled by 2.0, you have 50 pixels css content and 10 pixels scrollbar

(50 + 10) * 2 = 120 != 110

FrameView should really have a way to get the innerWidth and Height instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>579284</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-03-15 04:50:14 -0700</bug_when>
    <thetext>My example below is wrong, but the issue is still there.

According to http://www.quirksmode.org/mobile/tableViewport.html we should return the &apos;Dimensions of the visual viewport in CSS pixels.&apos;

CSSOM View says &apos;The innerWidth attribute must return the viewport width including the size of a rendered scroll bar (if any).&apos;


So we could reformulate both as

The visual viewport in CSS pixels including the size of non-overlay scroll bar (if any).


It still seems as it would be nice to keep the scrollbar size calculation separate from the visibleContentRect method.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>579289</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-03-15 05:10:32 -0700</bug_when>
    <thetext>LayoutTests/fast/dom/inner-width-height.html tests that it includes scrollbars, but with weird comments:

30     This tests that window.innerWidth/innerHeight does not include the size of the scrollbars.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>