<https://webkit.org/b/119806> [Mac] Add a way to easily test attributed string generation
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Aug 2013 03:04:07 +0000 (03:04 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Aug 2013 03:04:07 +0000 (03:04 +0000)
commit49c9e85f3ae56e20c42d5fe2297fa48a1636e809
treeae82668729fbba04e0bc18e40536fa640534c62e
parent59785ecf1c359918f36fe2506ebdbe0d8e9e76f3
<https://webkit.org/b/119806> [Mac] Add a way to easily test attributed string generation

Reviewed by Darin Adler.

Tools:

Add textInputController.legacyAttributedString to retrieve the attributed string for copy & paste.

We can't use textInputController.attributedSubstringFromRange as it uses WebHTMLConverter's static
editingAttributedStringFromRange function, which doesn't implement the full converter at the moment.

Also NSMutableAttributedString.ranges and WebNSRange so that JavaScript can get a list of all
ranges in a given attributed string.

* DumpRenderTree/mac/TextInputController.m:
(-[WebNSRange initWithNSRange:]):
(-[WebNSRange location]):
(-[WebNSRange length]):
(+[WebNSRange isSelectorExcludedFromWebScript:]):
(+[NSMutableAttributedString isSelectorExcludedFromWebScript:]):
(+[NSMutableAttributedString webScriptNameForSelector:]):
(-[NSMutableAttributedString ranges]): Added.
(+[TextInputController isSelectorExcludedFromWebScript:]):
(+[TextInputController webScriptNameForSelector:]):
(-[TextInputController legacyAttributedString:]):

LayoutTests:

Add basic tests for textInputController.legacyAttributedString.

* platform/mac-wk2/TestExpectations:
* platform/mac/editing/attributed-string: Added.
* platform/mac/editing/attributed-string/anchor-element-expected.txt: Added.
* platform/mac/editing/attributed-string/anchor-element.html: Added.
* platform/mac/editing/attributed-string/basic-expected.txt: Added.
* platform/mac/editing/attributed-string/basic.html: Added.
* platform/mac/editing/attributed-string/font-size-expected.txt: Added.
* platform/mac/editing/attributed-string/font-size.html: Added.
* platform/mac/editing/attributed-string/font-style-variant-effect-expected.txt: Added.
* platform/mac/editing/attributed-string/font-style-variant-effect.html: Added.
* platform/mac/editing/attributed-string/font-weight-expected.txt: Added.
* platform/mac/editing/attributed-string/font-weight.html: Added.
* platform/mac/editing/attributed-string/letter-spacing-expected.txt: Added.
* platform/mac/editing/attributed-string/letter-spacing.html: Added.
* platform/mac/editing/attributed-string/resources: Added.
* platform/mac/editing/attributed-string/resources/dump-attributed-string.js: Added.
(.):
* platform/mac/editing/attributed-string/text-decorations-expected.txt: Added.
* platform/mac/editing/attributed-string/text-decorations.html: Added.
* platform/mac/editing/attributed-string/vertical-align-expected.txt: Added.
* platform/mac/editing/attributed-string/vertical-align.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/editing/attributed-string/anchor-element-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/anchor-element.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/basic-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/basic.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-size-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-size.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-style-variant-effect-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-style-variant-effect.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-weight-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/font-weight.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/letter-spacing-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/letter-spacing.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/resources/dump-attributed-string.js [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/text-decorations-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/text-decorations.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/vertical-align-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/attributed-string/vertical-align.html [new file with mode: 0644]
Tools/ChangeLog
Tools/DumpRenderTree/mac/TextInputController.m