Gmail reply email - Bold and Italic style get stuck
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2013 04:55:02 +0000 (04:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2013 04:55:02 +0000 (04:55 +0000)
commit72ce184947cabaf66c58a1858d764cb22673bc55
treed38d71f15d18aa62fc437899cdde8469a220f17f
parentedf35bd2101737a44c8d0efc36757b5aea1ffd76
Gmail reply email - Bold and Italic style  get stuck
https://bugs.webkit.org/show_bug.cgi?id=118185

Patch by Vani Hegde <vani.hegde@samsung.com> on 2013-07-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

When bold/italic style is applied to a content with mixed editability,
style is applied appropriately for the first time.
But after this, style toggling does not work any more. Same behavior
can be observed when the content on which style is applied contains
text node without renderer (Ex: text node corresponding to tab/space etc)

When bold/italic style is applied on a selection, we actually apply the
style only for text nodes that have renderers and also are contenteditable.
Similarly during style toggling, to check whether a style has been already
applied on a selection

Tests: editing/style/toggle-style-bold-italic-mixed-editability.html
       editing/style/toggle-style-bold-italic.html

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::triStateOfStyle):
A particular selection on which style is applied may contain text nodes
without renderers(text nodes corresponding to tab/space) or text nodes
that are not contenteditable. We do not apply style to such text nodes.
Hence, even during style toggling we should not consider the styles
present in such nodes.

LayoutTests:

Layout tests added to test bold/italic style toggling on a content
with mixed editability.

* editing/editing.js:
(runDumpAsTextEditingTest): Replaced markupResultList with
elementsForDumpingMarkupList to store all markup data to be logged
at the end of test.
(debugForDumpAsText): Changed to use elementsForDumpingMarkupList.
(startNewMarkupGroup): Added utility function to hold intermediate
data by separating <ol>.
* editing/style/toggle-style-bold-italic-expected.txt: Added.
* editing/style/toggle-style-bold-italic-mixed-editability-expected.txt: Added.
* editing/style/toggle-style-bold-italic-mixed-editability.html: Added.
* editing/style/toggle-style-bold-italic.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/editing.js
LayoutTests/editing/style/toggle-style-bold-italic-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html [new file with mode: 0644]
LayoutTests/editing/style/toggle-style-bold-italic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingStyle.cpp