[iOS] Caret x-position in empty text area does not match text field
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 21:07:19 +0000 (21:07 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 21:07:19 +0000 (21:07 +0000)
commit22641f062acd59cb44e6b954ce44880e866745a7
tree82cdd7cd7a441779101e24ef4581d725373f7659
parentf9156ec69bc11819745e7fce773b84c7e771d6c9
[iOS] Caret x-position in empty text area does not match text field
https://bugs.webkit.org/show_bug.cgi?id=195125
<rdar://problem/47161070>

Reviewed by Darin Adler.

Source/WebCore:

Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
width and same text-indent as <input type="text">. This makes the x-position of the caret
in an empty textarea match the position of the caret in an empty text field.

Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html

* css/html.css:
(textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
and do not specify left and right padding so that we inherit the padding set earlier in this file.
(textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
text so as to match the position of the textarea's inner text and the position of a text field's inner
text. This fix up may have worked out visually when it was added, but based on the discovery of the
hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.

LayoutTests:

Update expected results due to changes in padding.

* TestExpectations: Remove some tests that are now passing.
* editing/selection/ios/show-selection-in-empty-overflow-hidden-document-expected.txt:
* editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html:
* fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield-expected.txt: Added.
* fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html: Added.
* platform/ios-wk2/editing/input/reveal-caret-of-multiline-input-expected.txt:
* platform/ios-wk2/editing/inserting/4960120-1-expected.txt:
* platform/ios-wk2/editing/pasteboard/pasting-tabs-expected.txt:
* platform/ios-wk2/fast/block/float/overhanging-tall-block-expected.txt:
* platform/ios-wk2/fast/block/margin-collapse/103-expected.txt:
* platform/ios-wk2/fast/dom/HTMLTextAreaElement/reset-textarea-expected.txt:
* platform/ios-wk2/fast/dynamic/008-expected.txt:
* platform/ios-wk2/fast/forms/basic-textareas-expected.txt:
* platform/ios-wk2/fast/forms/textAreaLineHeight-expected.txt:
* platform/ios-wk2/fast/forms/textarea-align-expected.txt:
* platform/ios-wk2/fast/forms/textarea-placeholder-pseudo-style-expected.txt:
* platform/ios-wk2/fast/forms/textarea-placeholder-visibility-1-expected.txt:
* platform/ios-wk2/fast/forms/textarea-placeholder-visibility-2-expected.txt:
* platform/ios-wk2/fast/forms/textarea-scroll-height-expected.txt:
* platform/ios-wk2/fast/forms/textarea-scrollbar-expected.txt:
* platform/ios-wk2/fast/forms/textarea-scrolled-type-expected.txt:
* platform/ios-wk2/fast/forms/textarea-setinnerhtml-expected.txt:
* platform/ios-wk2/fast/hidpi/resize-corner-hidpi-expected.txt:
* platform/ios-wk2/fast/overflow/overflow-x-y-expected.txt:
* platform/ios-wk2/fast/text/international/rtl-white-space-pre-wrap-expected.txt:
* platform/ios-wk2/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
* platform/ios/TestExpectations:
* platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt:
* platform/ios/fast/forms/form-element-geometry-expected.txt:
* platform/ios/fast/forms/linebox-overflow-in-textarea-padding-expected.txt:
* platform/ios/fast/forms/negativeLineHeight-expected.txt:
* platform/ios/fast/forms/text-control-intrinsic-widths-expected.txt:
* platform/ios/fast/forms/textarea-width-expected.txt:
* platform/ios/fast/replaced/width100percent-textarea-expected.txt:
* platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt:
* platform/ios/tables/mozilla/bugs/bug194024-expected.txt:
* platform/ios/tables/mozilla/bugs/bug30559-expected.txt:
* platform/ios/tables/mozilla/bugs/bug30692-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/editing/selection/ios/show-selection-in-empty-overflow-hidden-document-expected.txt
LayoutTests/editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
LayoutTests/fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html [new file with mode: 0644]
LayoutTests/platform/ios-wk2/editing/input/reveal-caret-of-multiline-input-expected.txt
LayoutTests/platform/ios-wk2/editing/inserting/4960120-1-expected.txt
LayoutTests/platform/ios-wk2/editing/pasteboard/pasting-tabs-expected.txt
LayoutTests/platform/ios-wk2/fast/block/float/overhanging-tall-block-expected.txt
LayoutTests/platform/ios-wk2/fast/block/margin-collapse/103-expected.txt
LayoutTests/platform/ios-wk2/fast/dom/HTMLTextAreaElement/reset-textarea-expected.txt
LayoutTests/platform/ios-wk2/fast/dynamic/008-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/basic-textareas-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textAreaLineHeight-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-align-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-placeholder-pseudo-style-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-placeholder-visibility-1-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-placeholder-visibility-2-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-scroll-height-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-scrollbar-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-scrolled-type-expected.txt
LayoutTests/platform/ios-wk2/fast/forms/textarea-setinnerhtml-expected.txt
LayoutTests/platform/ios-wk2/fast/hidpi/resize-corner-hidpi-expected.txt
LayoutTests/platform/ios-wk2/fast/overflow/overflow-x-y-expected.txt
LayoutTests/platform/ios-wk2/fast/text/international/rtl-white-space-pre-wrap-expected.txt
LayoutTests/platform/ios-wk2/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt
LayoutTests/platform/ios/fast/forms/form-element-geometry-expected.txt
LayoutTests/platform/ios/fast/forms/linebox-overflow-in-textarea-padding-expected.txt
LayoutTests/platform/ios/fast/forms/negativeLineHeight-expected.txt
LayoutTests/platform/ios/fast/forms/text-control-intrinsic-widths-expected.txt
LayoutTests/platform/ios/fast/forms/textarea-width-expected.txt
LayoutTests/platform/ios/fast/replaced/width100percent-textarea-expected.txt
LayoutTests/platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt
LayoutTests/platform/ios/tables/mozilla/bugs/bug194024-expected.txt
LayoutTests/platform/ios/tables/mozilla/bugs/bug30559-expected.txt
LayoutTests/platform/ios/tables/mozilla/bugs/bug30692-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/html.css
Source/WebCore/html/HTMLTextAreaElement.cpp