CSSStyleDeclaration.cssText should not contain extraneous whitespace in final delimiter
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 23:58:43 +0000 (23:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 23:58:43 +0000 (23:58 +0000)
commitcae89383cc531cb269528aaddd12a00bdeefa36c
treea1cad41ffa9ffded5ee501dfcffc59f312753354
parent6545f4f1bcc2511ced8f612b01cc3138279e7331
CSSStyleDeclaration.cssText should not contain extraneous whitespace in final delimiter
https://bugs.webkit.org/show_bug.cgi?id=94633

Patch by Glenn Adams <glenn@skynav.com> on 2012-08-24
Reviewed by Benjamin Poulain.

Ensure cssText final delimiter does not contain extraneous space character after semicolon.

Source/WebCore:

Test: cssom/cssstyledeclaration-csstext-final-delimiter.html

* css/CSSFontFaceRule.cpp:
(WebCore::CSSFontFaceRule::cssText):
Conditionally add SPACE in serialized rule since asText() no longer
contains extra space.
Construct result using StringBuilder.

* css/CSSPageRule.cpp:
(WebCore::CSSPageRule::cssText):
Conditionally add SPACE in serialized rule since asText() no longer
contains extra space.
Construct result using StringBuilder.

* css/CSSProperty.cpp:
(WebCore::CSSProperty::cssText):
Ensure serialized property does longer contains extra space in cssText.
Construct result using StringBuilder.

* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::cssText):
Conditionally add SPACE in serialized rule since asText() no longer
contains extra space.
Construct result using StringBuilder.

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addRule):
Conditionally add SPACE in reserialized rule in case passed style no
longer contains extra space.  Note that if it does already contain an
extra space that inserting an extra space here is harmless (i.e., is
effectively normalized during parse).
Construct result using StringBuilder.

* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::asText):
Ensure serialized property set does longer contains extra space in final
delimiter.
Construct result using StringBuilder.

* css/WebKitCSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::cssText):
Conditionally add SPACE in serialized rule since asText() no longer
contains extra space.
Construct result using StringBuilder.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::addBlockStyle):
Conditionally add SPACE in block style since cssText no longer contains
extra space.
Construct result using StringBuilder.
(WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
Conditionally add SPACE in pre-existing inline style since cssText no
longer contains extra space.
Construct result using StringBuilder.

LayoutTests:

* cssom/README.txt: Added.
* cssom/cssstyledeclaration-csstext-final-delimiter-expected.txt: Added.
* cssom/cssstyledeclaration-csstext-final-delimiter.html: Added.
* editing/deleting/delete-line-break-before-underlined-content-expected.txt: Remove extraneous space.
* editing/deleting/delete-line-break-between-paragraphs-with-same-style-expected.txt: ditto
* editing/deleting/deleting-line-break-preserves-underline-color-expected.txt: ditto
* editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt: ditto
* editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: ditto
* editing/deleting/merge-paragraph-from-p-with-style-3-expected.txt: ditto
* editing/deleting/merge-paragraph-from-p-with-style-expected.txt: ditto
* editing/deleting/paste-with-transparent-background-color-expected.txt: ditto
* editing/execCommand/insert-list-with-noneditable-content-expected.txt: ditto
* editing/execCommand/script-tests/toggle-link.js: ditto
* editing/execCommand/script-tests/toggle-unlink.js: ditto
* editing/execCommand/toggle-link-expected.txt: ditto
* editing/execCommand/toggle-unlink-expected.txt: ditto
* editing/inserting/page-zoom-font-size-expected.txt: ditto
* editing/pasteboard/19644-2-expected.txt: ditto
* editing/pasteboard/5761530-1-expected.txt: ditto
* editing/pasteboard/5780697-2-expected.txt: ditto
* editing/pasteboard/copy-null-characters-expected.txt: ditto
* editing/pasteboard/copy-paste-bidi-expected.txt: ditto
* editing/pasteboard/copy-text-with-backgroundcolor-expected.txt: ditto
* editing/pasteboard/data-transfer-items-expected.txt: ditto
* editing/pasteboard/display-block-on-spans-expected.txt: ditto
* editing/pasteboard/do-not-copy-unnecessary-styles-2-expected.txt: ditto
* editing/pasteboard/do-not-copy-unnecessary-styles-expected.txt: ditto
* editing/pasteboard/drag-drop-url-with-style-expected.txt: ditto
* editing/pasteboard/onpaste-text-html-expected.txt: ditto
* editing/pasteboard/paste-4039777-fix-expected.txt: ditto
* editing/pasteboard/paste-and-sanitize-expected.txt: ditto
* editing/pasteboard/paste-and-sanitize.html: ditto
* editing/pasteboard/paste-list-003-expected.txt: ditto
* editing/pasteboard/paste-noscript-expected.txt: ditto
* editing/pasteboard/paste-noscript-xhtml-expected.txt: ditto
* editing/pasteboard/paste-table-002-expected.txt: ditto
* editing/pasteboard/paste-text-with-style-4-expected.txt: ditto
* editing/pasteboard/paste-text-with-style-5-expected.txt: ditto
* editing/pasteboard/paste-with-redundant-style-expected.txt: ditto
* editing/pasteboard/preserve-underline-color-expected.txt: ditto
* editing/pasteboard/style-from-rules-expected.txt: ditto
* editing/pasteboard/testcase-9507-expected.txt: ditto
* editing/style/non-inheritable-styles-expected.txt: ditto
* editing/style/push-down-font-styles-expected.txt: ditto
* editing/style/push-down-implicit-styles-around-list-expected.txt: ditto
* editing/style/push-down-implicit-styles-expected.txt: ditto
* editing/style/push-down-inline-styles-expected.txt: ditto
* editing/style/script-tests/push-down-font-styles.js: ditto
* editing/style/script-tests/push-down-implicit-styles-around-list.js: ditto
* editing/style/script-tests/push-down-implicit-styles.js: ditto
* editing/style/script-tests/push-down-inline-styles.js: ditto
* editing/undo/remove-css-property-and-remove-style-expected.txt: ditto
* editing/undo/replace-by-span-then-remove-expected.txt: ditto
* editing/undo/replace-by-span-then-remove.html: ditto
* fast/css/background-position-serialize.html: ditto
* fast/css/counters/counter-cssText-expected.txt: ditto
* fast/css/counters/counter-cssText.html: ditto
* fast/css/parse-border-image-repeat-null-crash-expected.txt: ditto
* fast/css/remove-shorthand.html: ditto
* fast/dom/Element/scrollWidth.html: ditto
* fast/dom/HTMLMeterElement/meter-element-markup-expected.txt: ditto
* fast/dom/HTMLProgressElement/progress-element-markup-expected.txt: ditto
* fast/dom/attr-style-too-lazy-expected.txt: ditto
* fast/dom/attr-style-too-lazy.html: ditto
* fast/dom/css-set-property-exception-expected.txt: ditto
* fast/fast/events/ondrop-text-html-expected.txt: ditto
* fast/mutation/observe-attributes-expected.txt: ditto
* fast/mutation/observe-attributes.html: ditto
* inspector/elements/insert-node-expected.txt: ditto
* inspector/styles/styles-update-from-js-expected.txt: ditto
* platform/chromium-win/editing/pasteboard/5780697-2-expected.txt: ditto
* platform/efl/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt: ditto
* platform/mac/editing/pasteboard/5761530-1-expected.txt: ditto
* platform/qt/editing/pasteboard/5761530-1-expected.txt: ditto
* platform/qt/editing/pasteboard/5780697-2-expected.txt: ditto
* svg/webarchive/svg-script-subresouces-expected.webarchive: ditto
* webarchive/test-link-rel-icon-beforeload-expected.webarchive: ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
89 files changed:
LayoutTests/ChangeLog
LayoutTests/cssom/README.txt [new file with mode: 0644]
LayoutTests/cssom/cssstyledeclaration-csstext-final-delimiter-expected.txt [new file with mode: 0644]
LayoutTests/cssom/cssstyledeclaration-csstext-final-delimiter.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-line-break-before-underlined-content-expected.txt
LayoutTests/editing/deleting/delete-line-break-between-paragraphs-with-same-style-expected.txt
LayoutTests/editing/deleting/deleting-line-break-preserves-underline-color-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style-3-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style-expected.txt
LayoutTests/editing/deleting/paste-with-transparent-background-color-expected.txt
LayoutTests/editing/execCommand/insert-list-with-noneditable-content-expected.txt
LayoutTests/editing/execCommand/script-tests/toggle-link.js
LayoutTests/editing/execCommand/script-tests/toggle-unlink.js
LayoutTests/editing/execCommand/toggle-link-expected.txt
LayoutTests/editing/execCommand/toggle-unlink-expected.txt
LayoutTests/editing/inserting/page-zoom-font-size-expected.txt
LayoutTests/editing/pasteboard/19644-2-expected.txt
LayoutTests/editing/pasteboard/5761530-1-expected.txt
LayoutTests/editing/pasteboard/5780697-2-expected.txt
LayoutTests/editing/pasteboard/copy-null-characters-expected.txt
LayoutTests/editing/pasteboard/copy-paste-bidi-expected.txt
LayoutTests/editing/pasteboard/copy-text-with-backgroundcolor-expected.txt
LayoutTests/editing/pasteboard/data-transfer-items-expected.txt
LayoutTests/editing/pasteboard/display-block-on-spans-expected.txt
LayoutTests/editing/pasteboard/do-not-copy-unnecessary-styles-2-expected.txt
LayoutTests/editing/pasteboard/do-not-copy-unnecessary-styles-expected.txt
LayoutTests/editing/pasteboard/drag-drop-url-with-style-expected.txt
LayoutTests/editing/pasteboard/onpaste-text-html-expected.txt
LayoutTests/editing/pasteboard/onpaste-text-html.html
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.txt
LayoutTests/editing/pasteboard/paste-and-sanitize-expected.txt
LayoutTests/editing/pasteboard/paste-and-sanitize.html
LayoutTests/editing/pasteboard/paste-list-003-expected.txt
LayoutTests/editing/pasteboard/paste-noscript-expected.txt
LayoutTests/editing/pasteboard/paste-noscript-xhtml-expected.txt
LayoutTests/editing/pasteboard/paste-table-002-expected.txt
LayoutTests/editing/pasteboard/paste-text-with-style-4-expected.txt
LayoutTests/editing/pasteboard/paste-text-with-style-5-expected.txt
LayoutTests/editing/pasteboard/paste-with-redundant-style-expected.txt
LayoutTests/editing/pasteboard/preserve-underline-color-expected.txt
LayoutTests/editing/pasteboard/style-from-rules-expected.txt
LayoutTests/editing/pasteboard/testcase-9507-expected.txt
LayoutTests/editing/style/non-inheritable-styles-expected.txt
LayoutTests/editing/style/push-down-font-styles-expected.txt
LayoutTests/editing/style/push-down-implicit-styles-around-list-expected.txt
LayoutTests/editing/style/push-down-implicit-styles-expected.txt
LayoutTests/editing/style/push-down-inline-styles-expected.txt
LayoutTests/editing/style/script-tests/push-down-font-styles.js
LayoutTests/editing/style/script-tests/push-down-implicit-styles-around-list.js
LayoutTests/editing/style/script-tests/push-down-implicit-styles.js
LayoutTests/editing/style/script-tests/push-down-inline-styles.js
LayoutTests/editing/undo/remove-css-property-and-remove-style-expected.txt
LayoutTests/editing/undo/replace-by-span-then-remove-expected.txt
LayoutTests/editing/undo/replace-by-span-then-remove.html
LayoutTests/fast/css/background-position-serialize.html
LayoutTests/fast/css/counters/counter-cssText-expected.txt
LayoutTests/fast/css/counters/counter-cssText.html
LayoutTests/fast/css/parse-border-image-repeat-null-crash-expected.txt
LayoutTests/fast/css/remove-shorthand.html
LayoutTests/fast/dom/Element/scrollWidth.html
LayoutTests/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt
LayoutTests/fast/dom/HTMLProgressElement/progress-element-markup-expected.txt
LayoutTests/fast/dom/attr-style-too-lazy-expected.txt
LayoutTests/fast/dom/attr-style-too-lazy.html
LayoutTests/fast/dom/css-set-property-exception-expected.txt
LayoutTests/fast/events/ondrop-text-html-expected.txt
LayoutTests/fast/events/ondrop-text-html.html
LayoutTests/fast/mutation/observe-attributes-expected.txt
LayoutTests/fast/mutation/observe-attributes.html
LayoutTests/inspector/elements/insert-node-expected.txt
LayoutTests/inspector/styles/styles-update-from-js-expected.txt
LayoutTests/platform/chromium-win/editing/pasteboard/5780697-2-expected.txt
LayoutTests/platform/efl/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt
LayoutTests/platform/mac/editing/pasteboard/5761530-1-expected.txt
LayoutTests/platform/qt/editing/pasteboard/5761530-1-expected.txt
LayoutTests/platform/qt/editing/pasteboard/5780697-2-expected.txt
LayoutTests/svg/webarchive/svg-script-subresouces-expected.webarchive
LayoutTests/webarchive/test-link-rel-icon-beforeload-expected.webarchive
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceRule.cpp
Source/WebCore/css/CSSPageRule.cpp
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSStyleRule.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/WebKitCSSKeyframeRule.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp