Guest User

Overflow:Problems

a guest
Dec 20th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.48 KB | None | 0 0
  1. <!--
  2.     Specification parts:
  3.  
  4.     1 - UAs must apply the 'overflow' property set on the root element to the viewport.
  5.     2 - When the root element is an HTML "HTML" element or an XHTML "html" element,
  6.         and that element has an HTML "BODY" element or an XHTML "body" element as a child,
  7.         user agents must instead apply the 'overflow' property from the first such child element to the viewport,
  8.         if the value on the root element is 'visible'.
  9.     3 - The 'visible' value when used for the viewport must be interpreted as 'auto'.
  10.     4 - The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
  11.     5 - overflow:auto The behavior of the 'auto' value is user agent-dependent, but should
  12.         cause a scrolling mechanism to be provided for overflowing boxes.
  13.     6 - A descendant box is positioned absolutely, partly outside the box. Such boxes are not
  14.          always clipped by the overflow property on their ancestors; specifically,
  15.         they are not clipped by the overflow of any ancestor between themselves and their containing block
  16. -->
  17.  
  18. <html style="overflow:visible">
  19.     <body style="overflow:visible">
  20.         Single case where overflow must be propagated from the body to the viewport (2) interpreted as overflow:auto (3)
  21.         and should present a scrollbar (5)
  22.     </body>
  23. </html>
  24.  
  25. <html style="overflow:visible">
  26.     <body style="overflow:hidden">  
  27.         This case propagation check happens but fails due to (4), instead applies (1) interpreted as overflow:auto (3)
  28.         and should present a scrollbar (5)
  29.     </body>
  30. </html>
  31.  
  32. <html style="overflow:hidden">
  33.     <body style="overflow:visible">  
  34.         No propagation check happens (2), instead applies (1)
  35.     </body>
  36. </html>
  37.  
  38. <html>
  39.     <body style="overflow:hidden">  
  40.         Propagation check does not occur due to (2) as the root element should default to overflow:auto not overflow:visible
  41.         If overflow:visible is the default for the root element in FF, the viewport should still interpret this as overflow:auto (3)
  42.         and present a scrollbar (5)
  43.     </body>
  44. </body>
  45.  
  46. <html>
  47.     <body style="overflow:hidden; margin-bottom:1100px">
  48.         <div style="position:absolute; top:1000px">
  49.             As it stands now there is no GUI presented to scroll down to this div if the viewport is smaller than 1000px
  50.             even though the content is not clipped (6)
  51.         </div>
  52.     </body>
  53. </html>
  54.  
  55. <html style="overflow:hidden">
  56.     <body style="overflow:visible">
  57.         <div style="position:absolute; top:1000px">
  58.             This, if FF was standards compliant, would allow the author to disable the UA's scrollbar on the
  59.             initial containing element and apply their own logic to the body's scrollbar as desired.
  60.         </div>
  61.     </body>
  62. </html>
  63.  
  64. <html style="overflow:visible">
  65.     <body style="overflow: /*...insert value...*/; margin: 50px -50px">
  66.             This probably shows why it's a problem most easily.
  67.             overflow:auto - presents 2 scrollbars, one for the UA and one for the body
  68.             overflow:visible - presents 1 scrollbar for the UA
  69.             overflow:hidden - removes both scrollbars
  70.             overflow:scroll - presents 2 scrollbars
  71.            
  72.             overflow:visible should present 2 scrollbars when appropriate
  73.             overflow:hidden should only hide the body's scrollbar not the initial containing element's scrollbar as well.
  74.  
  75.             Due to Firefox's handling in the current way you can no longer create a script that simply uses margins to frame
  76.             a document to a device without modifying the contents within the body.  Instead you'd have to insert a wrapping div
  77.             to regain proper control of the overflow.
  78.     </body>
  79. </html>
Add Comment
Please, Sign In to add comment