1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67

content / test / data / accessibility / html / overflow-scroller.html [blame]

<!DOCTYPE html>
<!--
@BLINK-ALLOW:focusable*
@EXECUTE-AND-WAIT-FOR:addOverflowAutoRule()
@EXECUTE-AND-WAIT-FOR:onlySmallContent()
@EXECUTE-AND-WAIT-FOR:onlyLargeContent()
@EXECUTE-AND-WAIT-FOR:useSmallFontInParagraph()
@EXECUTE-AND-WAIT-FOR:useLargeFontInParagraph()
@EXECUTE-AND-WAIT-FOR:removeOverflowAutoRule()
@EXECUTE-AND-WAIT-FOR:readdOverflowAutoRule()
-->
<style>
/* Make paragraphs large so that there is overflow with scrollbars */
p { font-size: 50px; }
/* Make blockquote tiny so that there is no overflow with scrollbars */
blockquote { font-size: 1px; }
</style>

<div id='div1' title='1234' style='overflow:scroll; width: 200px; height:50px'>
  <p id='p1'>Example Paragraph 1</p>
  <p id='p2'>Example Paragraph 2</p>
</div>

<script>
function addOverflowAutoRule() {
  document.getElementById('div1').style.overflow = 'auto';
  document.title = 'overflow-auto';
  return 'overflow-auto';
}

function onlySmallContent() {
  document.getElementById('div1').innerHTML = '<blockquote>small</blockquote>';
  document.title = 'only-small-content';
  return 'only-small-content';
}

function onlyLargeContent() {
  document.getElementById('div1').insertAdjacentHTML('beforeend', '<p>large content</p>');
  document.title = 'large-content'
  return 'large-content';
}

function useSmallFontInParagraph() {
  document.querySelector('p').style.fontSize = '1px';
  document.title = 'p-font-small';
  return 'p-font-small';
}

function useLargeFontInParagraph() {
  document.querySelector('p').style.fontSize = '50px';
  document.title = 'p-font-large';
  return 'p-font-large';
}

function removeOverflowAutoRule() {
  document.getElementById('div1').style.overflow = 'hidden';
  document.title = 'overflow-hidden';
  return 'overflow-hidden';
}

function readdOverflowAutoRule() {
  document.getElementById('div1').style.overflow = 'auto';
  document.title = 'finished';
  return 'finished';
}

</script>