Changeset 153509 in webkit
- Timestamp:
- Jul 30, 2013 9:55:02 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r153508 r153509 1 2013-07-30 Vani Hegde <vani.hegde@samsung.com> 2 3 Gmail reply email - Bold and Italic style get stuck 4 https://bugs.webkit.org/show_bug.cgi?id=118185 5 6 Reviewed by Ryosuke Niwa. 7 8 Layout tests added to test bold/italic style toggling on a content 9 with mixed editability. 10 11 * editing/editing.js: 12 (runDumpAsTextEditingTest): Replaced markupResultList with 13 elementsForDumpingMarkupList to store all markup data to be logged 14 at the end of test. 15 (debugForDumpAsText): Changed to use elementsForDumpingMarkupList. 16 (startNewMarkupGroup): Added utility function to hold intermediate 17 data by separating <ol>. 18 * editing/style/toggle-style-bold-italic-expected.txt: Added. 19 * editing/style/toggle-style-bold-italic-mixed-editability-expected.txt: Added. 20 * editing/style/toggle-style-bold-italic-mixed-editability.html: Added. 21 * editing/style/toggle-style-bold-italic.html: Added. 22 1 23 2013-07-30 Rob Buis <rwlbuis@webkit.org> 2 24 -
trunk/LayoutTests/editing/editing.js
r137953 r153509 905 905 906 906 var dumpAsText = false; 907 var markupResultList = document.createElement('ol');907 var elementsForDumpingMarkupList = [document.createElement('ol')]; 908 908 909 909 function runDumpAsTextEditingTest(enableCallbacks) { … … 921 921 editingTest(); 922 922 923 document.body.appendChild(markupResultList); 923 for (var i = 0; i < elementsForDumpingMarkupList.length; i++) 924 document.body.appendChild(elementsForDumpingMarkupList[i]); 924 925 } 925 926 … … 928 929 var newItem = document.createElement('li'); 929 930 newItem.appendChild(document.createTextNode(name+": "+document.getElementById("root").innerHTML)); 930 markupResultList.appendChild(newItem); 931 } 931 elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].appendChild(newItem); 932 } 933 } 934 935 function startNewMarkupGroup(label) { 936 if (!elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].hasChildNodes()) 937 elementsForDumpingMarkupList.pop(); 938 elementsForDumpingMarkupList.push(document.createElement('br')); 939 elementsForDumpingMarkupList.push(document.createTextNode(label)); 940 elementsForDumpingMarkupList.push(document.createElement('ol')); 932 941 } 933 942 -
trunk/Source/WebCore/ChangeLog
r153508 r153509 1 2013-07-30 Vani Hegde <vani.hegde@samsung.com> 2 3 Gmail reply email - Bold and Italic style get stuck 4 https://bugs.webkit.org/show_bug.cgi?id=118185 5 6 Reviewed by Ryosuke Niwa. 7 8 When bold/italic style is applied to a content with mixed editability, 9 style is applied appropriately for the first time. 10 But after this, style toggling does not work any more. Same behavior 11 can be observed when the content on which style is applied contains 12 text node without renderer (Ex: text node corresponding to tab/space etc) 13 14 When bold/italic style is applied on a selection, we actually apply the 15 style only for text nodes that have renderers and also are contenteditable. 16 Similarly during style toggling, to check whether a style has been already 17 applied on a selection 18 19 Tests: editing/style/toggle-style-bold-italic-mixed-editability.html 20 editing/style/toggle-style-bold-italic.html 21 22 * editing/EditingStyle.cpp: 23 (WebCore::EditingStyle::triStateOfStyle): 24 A particular selection on which style is applied may contain text nodes 25 without renderers(text nodes corresponding to tab/space) or text nodes 26 that are not contenteditable. We do not apply style to such text nodes. 27 Hence, even during style toggling we should not consider the styles 28 present in such nodes. 29 1 30 2013-07-30 Rob Buis <rwlbuis@webkit.org> 2 31 -
trunk/Source/WebCore/editing/EditingStyle.cpp
r152286 r153509 684 684 685 685 TriState state = FalseTriState; 686 bool nodeIsStart = true; 686 687 for (Node* node = selection.start().deprecatedNode(); node; node = NodeTraversal::next(node)) { 687 ComputedStyleExtractor computedStyle(node); 688 TriState nodeState = triStateOfStyle(&computedStyle, node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties); 689 if (node == selection.start().deprecatedNode()) 690 state = nodeState; 691 else if (state != nodeState && node->isTextNode()) { 692 state = MixedTriState; 693 break; 688 if (node->renderer() && node->rendererIsEditable()) { 689 ComputedStyleExtractor computedStyle(node); 690 TriState nodeState = triStateOfStyle(&computedStyle, node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties); 691 if (nodeIsStart) { 692 state = nodeState; 693 nodeIsStart = false; 694 } else if (state != nodeState && node->isTextNode()) { 695 state = MixedTriState; 696 break; 697 } 694 698 } 699 695 700 if (node == selection.end().deprecatedNode()) 696 701 break;
Note: See TracChangeset
for help on using the changeset viewer.