ToggleBold does not work in specific editable contents
authorKyungTae Kim <ktf.kim@samsung.com>
Wed, 3 Jul 2013 05:08:34 +0000 (14:08 +0900)
committerKyungTae Kim <ktf.kim@samsung.com>
Mon, 15 Jul 2013 11:27:58 +0000 (20:27 +0900)
[Title] ToggleBold does not work in specific editable contents
[Issue] P130610-4137
[Problem] In Email, ToggleBold does not work after 'select all' for some mails.
[Cause] The invisible text elements was included when checking triStateOfStyle.
[Solution] Add a checking routine for 'node->renderer' so that the invisible elements can't make the state as 'mixed'.
Added on opensource: http://webkit.org/b/118285

Change-Id: I721599d62b87a07bd39ca4a124c5d3e6f4059575

Source/WTF/wtf/Platform.h
Source/WebCore/editing/EditingStyle.cpp

index f78e14b..0621ea4 100755 (executable)
@@ -787,6 +787,8 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/
 #define ENABLE_TIZEN_ADJUST_CONTENTS_SIZE_FOR_MINUS_X_WORKAROUND 1 /*KyungTae Kim(ktf.kim@samsung.com) : Workaround patch that adjusts contents size of minus x position contents */
 #define ENABLE_TIZEN_EWK_CONTEXT_CACHE_MANAGER_NULL_CHECK_WORKAROUND 1 /* KyungTae Kim(ktf.kim@samsung.com) : Add null check to fix crash issue. */
 #define ENABLE_TIZEN_FRAMEVIEW_NULL_CHECK_WORKAROUND 1 /* KyungTae Kim(ktf.kim@samsung.com) : Add null check to fix crash issue. */
+#define ENABLE_TIZEN_EDITING_IGNORE_NONVISIBLE 1 /*KyungTae Kim(ktf.kim@samsung.com) : When checking styles for editing, ignore the element without renderer, to prevent to get 'mixed' although all the visible elements are 'true'*/
+
 
 #define ENABLE_TIZEN_DO_NOT_APPLY_SCROLLOFFSET_FOR_DELEGATESSCROLLING 1 /* Eunmi Lee(eunmi15.lee@samsung.com) : Fix the wrong position of hitTest result when we do hit test in the subFrame (It should be contributed to the opensource) */
 
index e9f6048..e649fb4 100644 (file)
@@ -694,7 +694,11 @@ TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
             TriState nodeState = triStateOfStyle(nodeStyle.get(), node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
             if (node == selection.start().deprecatedNode())
                 state = nodeState;
+#if ENABLE(TIZEN_EDITING_IGNORE_NONVISIBLE)
+            else if (state != nodeState && node->isTextNode() && node->renderer()) {
+#else
             else if (state != nodeState && node->isTextNode()) {
+#endif
                 state = MixedTriState;
                 break;
             }