WebKit Bugzilla
Attachment 341054 Details for
Bug 185897
: AX: setValue on contenteditable should preserve whitespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch.txt (text/plain), 4.00 KB, created by
Nan Wang
on 2018-05-22 18:26:21 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-05-22 18:26:21 PDT
Size:
4.00 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 232093) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-05-22 Nan Wang <n_wang@apple.com> >+ >+ AX: setValue on contenteditable should preserve whitespace >+ https://bugs.webkit.org/show_bug.cgi?id=185897 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ RenderText is using its parent renderer's style to determine if >+ whitespace collapsing is necessary. So when setting the innerText >+ of the element in setValue, let's also set its style in order to >+ preserve whitespaces. >+ >+ Modified an existing test to cover this change. >+ >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::setValue): >+ > 2018-05-22 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r232081. >Index: Source/WebCore/accessibility/AccessibilityRenderObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityRenderObject.cpp (revision 232040) >+++ Source/WebCore/accessibility/AccessibilityRenderObject.cpp (working copy) >@@ -1777,8 +1777,17 @@ void AccessibilityRenderObject::setValue > downcast<HTMLInputElement>(element).setValue(string); > else if (renderer.isTextArea() && is<HTMLTextAreaElement>(element)) > downcast<HTMLTextAreaElement>(element).setValue(string); >- else if (is<HTMLElement>(element) && contentEditableAttributeIsEnabled(&element)) >+ else if (is<HTMLElement>(element) && contentEditableAttributeIsEnabled(&element)) { > downcast<HTMLElement>(element).setInnerText(string); >+ // Set the style to the element so the child Text node won't collapse spaces >+ if (is<RenderElement>(renderer)) { >+ RenderElement& renderParent = downcast<RenderElement>(renderer); >+ auto style = RenderStyle::create(); >+ style.inheritFrom(renderParent.style()); >+ style.setWhiteSpace(PRE); >+ renderParent.setStyleInternal(WTFMove(style)); >+ } >+ } > } > > bool AccessibilityRenderObject::supportsARIAOwns() const >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 232040) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2018-05-22 Nan Wang <n_wang@apple.com> >+ >+ AX: setValue on contenteditable should preserve whitespace >+ https://bugs.webkit.org/show_bug.cgi?id=185897 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/mac/set-value-editable-types-expected.txt: >+ * accessibility/mac/set-value-editable-types.html: >+ > 2018-05-21 Aditya Keerthi <akeerthi@apple.com> > > Added test to verify behaviour when tapping multiple times on an editable node. >Index: LayoutTests/accessibility/mac/set-value-editable-types-expected.txt >=================================================================== >--- LayoutTests/accessibility/mac/set-value-editable-types-expected.txt (revision 232040) >+++ LayoutTests/accessibility/mac/set-value-editable-types-expected.txt (working copy) >@@ -9,7 +9,7 @@ Role: AXRole: AXTextArea > Value: AXValue: current1 > Writable: true > Value change notification received >-Updated Value: AXValue: new value >+Updated Value: AXValue: leading and trailing spaces > PASS successfullyParsed is true > > TEST COMPLETE >Index: LayoutTests/accessibility/mac/set-value-editable-types.html >=================================================================== >--- LayoutTests/accessibility/mac/set-value-editable-types.html (revision 232040) >+++ LayoutTests/accessibility/mac/set-value-editable-types.html (working copy) >@@ -37,7 +37,7 @@ > var writable = axElement.isAttributeSettable("AXValue"); > debug("Writable: " + writable); > >- axElement.setValue("new value"); >+ axElement.setValue(" leading and trailing spaces "); > } > > debug("\nContenteditable");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185897
:
341053
|
341054
|
341062
|
341068
|
341369
|
341376
|
341377
|
341385