Skip to content

Commit

Permalink
part 3: Add block-axis variants of textarea text-in-padding tests, to…
Browse files Browse the repository at this point in the history
… validate that text can render in block-end padding but not block-start padding.

This patch was mostly generated automatically (based off of neighboring tests),
using the following bash script (executed in the "the-textarea-element"
directory):

```
for inlineVer in ./textarea-padding-i*; do
  blockVer=`echo $inlineVer | sed "s/padding-i/padding-b/"`
  hg cp $inlineVer $blockVer
  # Fix the link tags pointing to reference cases:
  sed -i s/-istart-/-bstart-/g $blockVer
  sed -i s/-iend-/-bend-/g $blockVer
  # Swap "block" and "inline" terminology throughout the new copy:
  sed -i s/block/TEMPORARY-FOO/g $blockVer
  sed -i s/inline/block/g $blockVer
  sed -i s/TEMPORARY-FOO/inline/g $blockVer
done
```

After running that script, I added one additional "overflow:hidden" declaration
to the generated "textarea-padding-bend-overlaps-content-001.tentative.html"
file (and an explanatory comment), to suppress scrollbars that get generated
specifically for block-axis end-edge padding overflow.

Differential Revision: https://phabricator.services.mozilla.com/D152332

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1780444
gecko-commit: fb5353c55f7a9f79ede9ed97916ebf2a1b6d5372
gecko-reviewers: emilio
  • Loading branch information
dholbert authored and moz-wptsync-bot committed Jul 22, 2022
1 parent 47a943f commit a3a24b5
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Reference Case</title>

<link rel="stylesheet" href="/fonts/ahem.css">
<style>
textarea {
font: 10px/1 Ahem;

block-size: 8em;
inline-size: 10em;

padding-block-end: 0;
}
.rtl { direction: rtl; }
.vlr { writing-mode: vertical-lr; }
.vrl { writing-mode: vertical-rl; }
.slr { writing-mode: sideways-lr; }
.srl { writing-mode: sideways-rl; }
</style>
<textarea>X</textarea>
<textarea class="rtl">X</textarea>
<br>
<textarea class="vlr">X</textarea>
<textarea class="vrl">X</textarea>
<textarea class="slr">X</textarea>
<textarea class="srl">X</textarea>
<br>
<textarea class="vlr rtl">X</textarea>
<textarea class="vrl rtl">X</textarea>
<textarea class="slr rtl">X</textarea>
<textarea class="srl rtl">X</textarea>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test: padding-block-end on a textarea creates space that content can render into</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-textarea-element-2">
<link rel="match" href="textarea-padding-bend-overlaps-content-001-ref.html">

<link rel="stylesheet" href="/fonts/ahem.css">
<style>
textarea {
font: 10px/1 Ahem;

/* Zero out the content-box, leaving the padding area as the only
place where the contents might get rendered. */
block-size: 0;
inline-size: 10em;

padding-block-end: 8em;

/* The textarea's padding-block-end may create overflow in the block axis,
and hence generate a scrollbar in the testcase that's not present in the
reference case (and might be hard to properly mock up there). We avoid
this problem by suppressing scrollbars using "overflow:hidden": */
overflow: hidden;
}
.rtl { direction: rtl; }
.vlr { writing-mode: vertical-lr; }
.vrl { writing-mode: vertical-rl; }
.slr { writing-mode: sideways-lr; }
.srl { writing-mode: sideways-rl; }
</style>

<textarea>X</textarea>
<textarea class="rtl">X</textarea>
<br>
<textarea class="vlr">X</textarea>
<textarea class="vrl">X</textarea>
<textarea class="slr">X</textarea>
<textarea class="srl">X</textarea>
<br>
<textarea class="vlr rtl">X</textarea>
<textarea class="vrl rtl">X</textarea>
<textarea class="slr rtl">X</textarea>
<textarea class="srl rtl">X</textarea>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Reference Case</title>

<link rel="stylesheet" href="/fonts/ahem.css">
<style>
textarea {
font: 10px/1 Ahem;

block-size: 8em;
inline-size: 10em;

padding-block-start: 0;
padding-block-end: 0;
}
.rtl { direction: rtl; }
.vlr { writing-mode: vertical-lr; }
.vrl { writing-mode: vertical-rl; }
.slr { writing-mode: sideways-lr; }
.srl { writing-mode: sideways-rl; }
</style>

<textarea></textarea>
<textarea class="rtl"></textarea>
<br>
<textarea class="vlr"></textarea>
<textarea class="vrl"></textarea>
<textarea class="slr"></textarea>
<textarea class="srl"></textarea>
<br>
<textarea class="vlr rtl"></textarea>
<textarea class="vrl rtl"></textarea>
<textarea class="slr rtl"></textarea>
<textarea class="srl rtl"></textarea>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test: padding-block-start on a textarea moves the textarea content over, potentially out of the textarea's scrollport</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-textarea-element-2">
<link rel="match" href="textarea-padding-bstart-moves-content-001-ref.html">

<link rel="stylesheet" href="/fonts/ahem.css">
<style>
textarea {
font: 10px/1 Ahem;

/* Zero out the content-box, leaving the padding area as the only
place where the contents might get rendered. */
block-size: 0;
inline-size: 10em;

padding-block-start: 8em;
padding-block-end: 0;

/* We expect the textarea's content to overflow in the block direction,
which makes the textarea blank, aside from any scrollbars that might get
created by this overflow. We use overflow:hidden here to suppress these
scrollbars, so that the reference case can just use a trivial empty
textarea (without needing to worry about mocking up scrollbars of
precisely the right size). */
overflow: hidden;
}
.rtl { direction: rtl; }
.vlr { writing-mode: vertical-lr; }
.vrl { writing-mode: vertical-rl; }
.slr { writing-mode: sideways-lr; }
.srl { writing-mode: sideways-rl; }
</style>

<textarea>X</textarea>
<textarea class="rtl">X</textarea>
<br>
<textarea class="vlr">X</textarea>
<textarea class="vrl">X</textarea>
<textarea class="slr">X</textarea>
<textarea class="srl">X</textarea>
<br>
<textarea class="vlr rtl">X</textarea>
<textarea class="vrl rtl">X</textarea>
<textarea class="slr rtl">X</textarea>
<textarea class="srl rtl">X</textarea>

0 comments on commit a3a24b5

Please sign in to comment.