Skip to content

Commit 6e163e8

Browse files
author
Simon Pieters
committed
[cssom-view] Make devicePixelRatio take page zoom into account but ignore pinch zoom. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23228
1 parent 39b2417 commit 6e163e8

3 files changed

Lines changed: 43 additions & 17 deletions

File tree

cssom-view/Overview.html

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<h1>CSSOM View Module</h1>
1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 9 October 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 17 October 2013</h2>
2020

2121
<dl>
2222

@@ -83,7 +83,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
8383
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
8484
index at http://www.w3.org/TR/.</a></em>
8585

86-
<p>This is the 9 October 2013 Editor's Draft of CSSOM View. Please send
86+
<p>This is the 17 October 2013 Editor's Draft of CSSOM View. Please send
8787
comments to
8888
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
8989
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -117,7 +117,8 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
117117
<li><a href="#web-idl"><span class="secno">2.1 </span>Web IDL</a></ul></li>
118118
<li><a href="#terminology"><span class="secno">3 </span>Terminology</a>
119119
<ul class="toc">
120-
<li><a href="#css-pixels"><span class="secno">3.1 </span>CSS pixels</a></ul></li>
120+
<li><a href="#css-pixels"><span class="secno">3.1 </span>CSS pixels</a></li>
121+
<li><a href="#zooming"><span class="secno">3.2 </span>Zooming</a></ul></li>
121122
<li><a href="#common-infrastructure"><span class="secno">4 </span>Common Infrastructure</a>
122123
<ul class="toc">
123124
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a></ul></li>
@@ -433,6 +434,11 @@ <h3 id="css-pixels"><span class="secno">3.1 </span>CSS pixels</h3>
433434
are explicitly given there.</p>
434435

435436

437+
<h3 id="zooming"><span class="secno">3.2 </span>Zooming</h3>
438+
439+
<p>There are two kinds of zoom, <dfn id="page-zoom">page zoom</dfn> which affects the size of the initial viewport<!-- XXX ref -->, and <dfn id="pinch-zoom">pinch zoom</dfn> which acts like
440+
a magnifying glass and does not affect the initial viewport<!-- XXX ref --> or actual viewport<!-- XXX ref -->. <a href="#refsCSSDEVICEADAPT">[CSSDEVICEADAPT]</a>
441+
436442

437443
<h2 id="common-infrastructure"><span class="secno">4 </span>Common Infrastructure</h2>
438444

@@ -706,9 +712,15 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
706712
client window. If there is no client window this
707713
attribute must return zero. <!--fingerprint--></p>
708714

709-
<p>The <dfn id="dom-window-devicepixelratio" title="dom-Window-devicePixelRatio"><code>devicePixelRatio</code></dfn> attribute must return the result of dividing the size of a CSS pixel at 100%
710-
zoom by the size of a device pixel of the output device, in one dimension (vertical or horizontal). If the device pixel is not square, then the smaller of the
711-
vertical or horizontal size of the smallest bounding box of the device pixel must be used.
715+
<p>The <dfn id="dom-window-devicepixelratio" title="dom-Window-devicePixelRatio"><code>devicePixelRatio</code></dfn> attribute must return the result of the following algorithm:
716+
717+
<ol>
718+
<li><p>Let <var>CSS pixel size</var> be the size of a CSS pixel at the current <a href="#page-zoom">page zoom</a> scale factor and at a <a href="#pinch-zoom">pinch zoom</a> scale
719+
factor of 1.0.
720+
<li><p>Let <var>device pixel size</var> be the size of a device pixel of the output device, in one dimension (vertical or horizontal). If the device pixel is
721+
not square, then use the smaller of the vertical or horizontal size of the smallest bounding box of the device pixel.
722+
<li><p>Return the result of dividing <var>CSS pixel size</var> by <var>device pixel size</var>.
723+
</ol>
712724

713725

714726
<h4 id="the-features-argument-to-the-open()-method"><span class="secno">5.1 </span>The <var>features</var> argument to the <code title="">open()</code> method</h4>
@@ -1884,9 +1896,9 @@ <h2 id="events"><span class="secno">12 </span>Events</h2>
18841896

18851897
<h3 id="resizing-viewports"><span class="secno">12.1 </span>Resizing viewports</h3>
18861898

1887-
<p>Whenever a <a href="#viewport">viewport</a> has its width or height changed (e.g. as a result of the user resizing the browser window, or zooming in, or an
1888-
<code title="">iframe</code> element's dimensions are changed), the user agent must <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
1889-
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event</a> event named
1899+
<p>Whenever a <a href="#viewport">viewport</a> has its width or height changed (e.g. as a result of the user resizing the browser window, or changing the <a href="#page-zoom">page
1900+
zoom</a> scale factor, or an <code title="">iframe</code> element's dimensions are changed), the user agent must <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a>
1901+
to <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event</a> event named
18901902
<code title="">resize</code> at the <code class="external" data-anolis-spec="html"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#window">Window</a></code> object associated with that
18911903
<a href="#viewport">viewport</a>. If such a resize is ongoing over a period of time, the user agent must <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> that
18921904
task at a user-agent-defined interval while the resize is ongoing. <!--fingerprint--> <!-- e.g. if you change the width of an iframe with a transition -->
@@ -1943,6 +1955,9 @@ <h2 class="no-num" id="references">References</h2>
19431955
<div id="anolis-references"><dl><dt id="refsCSSBOX">[CSSBOX]
19441956
<dd><cite><a href="http://dev.w3.org/csswg/css-box/">CSS basic box model</a></cite>, Bert Bos and Anton Prowse. W3C.
19451957

1958+
<dt id="refsCSSDEVICEADAPT">[CSSDEVICEADAPT]
1959+
<dd><cite><a href="http://dev.w3.org/csswg/css-device-adapt/">CSS Device Adaptation</a></cite>, Rune Lillesveen, Øyvind Stenhaug and Florian Rivoal.
1960+
19461961
<dt id="refsCSSOM">[CSSOM]
19471962
<dd><cite><a href="http://dev.w3.org/csswg/cssom/">CSS Object Model (CSSOM)</a></cite>, Simon Pieters and Glenn Adams. W3C.
19481963

cssom-view/Overview.src.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ <h3>CSS pixels</h3>
391391
are explicitly given there.</p>
392392

393393

394+
<h3>Zooming</h3>
395+
396+
<p>There are two kinds of zoom, <dfn>page zoom</dfn> which affects the size of the initial viewport<!-- XXX ref -->, and <dfn>pinch zoom</dfn> which acts like
397+
a magnifying glass and does not affect the initial viewport<!-- XXX ref --> or actual viewport<!-- XXX ref -->. <span data-anolis-ref>CSSDEVICEADAPT</span>
398+
394399

395400
<h2>Common Infrastructure</h2>
396401

@@ -664,9 +669,15 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
664669
client window. If there is no client window this
665670
attribute must return zero. <!--fingerprint--></p>
666671

667-
<p>The <dfn title=dom-Window-devicePixelRatio><code>devicePixelRatio</code></dfn> attribute must return the result of dividing the size of a CSS pixel at 100%
668-
zoom by the size of a device pixel of the output device, in one dimension (vertical or horizontal). If the device pixel is not square, then the smaller of the
669-
vertical or horizontal size of the smallest bounding box of the device pixel must be used.
672+
<p>The <dfn title=dom-Window-devicePixelRatio><code>devicePixelRatio</code></dfn> attribute must return the result of the following algorithm:
673+
674+
<ol>
675+
<li><p>Let <var>CSS pixel size</var> be the size of a CSS pixel at the current <span>page zoom</span> scale factor and at a <span>pinch zoom</span> scale
676+
factor of 1.0.
677+
<li><p>Let <var>device pixel size</var> be the size of a device pixel of the output device, in one dimension (vertical or horizontal). If the device pixel is
678+
not square, then use the smaller of the vertical or horizontal size of the smallest bounding box of the device pixel.
679+
<li><p>Return the result of dividing <var>CSS pixel size</var> by <var>device pixel size</var>.
680+
</ol>
670681

671682

672683
<h4>The <var>features</var> argument to the <code title>open()</code> method</h4>
@@ -1842,9 +1853,9 @@ <h2>Events</h2>
18421853

18431854
<h3>Resizing viewports</h3>
18441855

1845-
<p>Whenever a <span>viewport</span> has its width or height changed (e.g. as a result of the user resizing the browser window, or zooming in, or an
1846-
<code title>iframe</code> element's dimensions are changed), the user agent must <span data-anolis-spec=html>queue a task</span> to
1847-
<span data-anolis-spec=dom title=concept-event-fire>fire an event</span> event named
1856+
<p>Whenever a <span>viewport</span> has its width or height changed (e.g. as a result of the user resizing the browser window, or changing the <span>page
1857+
zoom</span> scale factor, or an <code title>iframe</code> element's dimensions are changed), the user agent must <span data-anolis-spec=html>queue a task</span>
1858+
to <span data-anolis-spec=dom title=concept-event-fire>fire an event</span> event named
18481859
<code title>resize</code> at the <code data-anolis-spec=html>Window</code> object associated with that
18491860
<span>viewport</span>. If such a resize is ongoing over a period of time, the user agent must <span data-anolis-spec=html title="queue a task">queue</span> that
18501861
task at a user-agent-defined interval while the resize is ongoing. <!--fingerprint--> <!-- e.g. if you change the width of an iframe with a transition -->

cssom/Overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<h1>CSS Object Model (CSSOM)</h1>
1717

1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 10 October 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 17 October 2013</h2>
2020

2121
<dl>
2222

@@ -90,7 +90,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
9090
can be found in the
9191
<a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em>
9292

93-
<p class="dontpublish">This is the 10 October 2013 Editor's Draft of CSSOM. Please send comments to
93+
<p class="dontpublish">This is the 17 October 2013 Editor's Draft of CSSOM. Please send comments to
9494
<a href="mailto:www-style@w3.org?subject=%5Bcssom%5D%20">www-style@w3.org</a>
9595
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
9696
with <samp>[cssom]</samp> at the start of the subject line.

0 commit comments

Comments
 (0)