Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2015 21:38:31 +0000 (21:38 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2015 21:38:31 +0000 (21:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146379

Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by WebKit not updating the font panel when the typing style changes.
There was also a bug that WebKit never updated font attributes on OS X.

Fixed the bugs by always updating the font panel after applying style instead of only
when the selection changes and setting the font attributes.

I tried really had to write a WebKit API test but I couldn't get it to work so there are
no new tests :(

* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::applyStyle):
(WebCore::Editor::shouldApplyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::applyStyleToSelection):
(WebCore::Editor::applyParagraphStyleToSelection):
(WebCore::Editor::selectionStartHasStyle):
(WebCore::Editor::document):
(WebCore::Editor::styleForSelectionStart): Deleted.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
* editing/cocoa/EditorCocoa.mm: Added.
(WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
fontAttributesForSelectionStart implementation.
* editing/cocoa/HTMLConverter.mm:
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontAttributesForSelectionStart):
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontAttributesForSelectionStart):
* loader/EmptyClients.h:
* page/EditorClient.h:

Source/WebKit/mac:

Update the font panel when newly added EditorClient::didApplyStyle is called. Also set the font attributes
in _updateFontPanel so that underline and strike through states will be reflected.

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::shouldApplyStyle):
(updateFontPanelIfNeeded): Extracted from respondToChangedContents.
(WebEditorClient::didApplyStyle): Added.
(WebEditorClient::respondToChangedContents):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _updateFontPanel]): Sets font attributes as well as font.

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::didApplyStyle): Added.
* WebCoreSupport/WebEditorClient.h:

Source/WebKit2:

Since font panel doesn't open in WebKit2 at the moment, just add an empty implementation of didApplyStyle

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::didApplyStyle):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/cocoa/EditorCocoa.h [new file with mode: 0644]
Source/WebCore/editing/cocoa/EditorCocoa.mm [new file with mode: 0644]
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/EditorClient.h
Source/WebCore/platform/spi/cocoa/NSAttributedStringSPI.h [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
Source/WebKit/win/WebCoreSupport/WebEditorClient.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.h

index 677d7e2..93a4f85 100644 (file)
@@ -1,3 +1,43 @@
+2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=146379
+
+        Reviewed by Darin Adler.
+
+        The bug was caused by WebKit not updating the font panel when the typing style changes.
+        There was also a bug that WebKit never updated font attributes on OS X.
+
+        Fixed the bugs by always updating the font panel after applying style instead of only
+        when the selection changes and setting the font attributes.
+
+        I tried really had to write a WebKit API test but I couldn't get it to work so there are
+        no new tests :(
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * editing/Editor.cpp:
+        (WebCore::Editor::applyStyle):
+        (WebCore::Editor::shouldApplyStyle):
+        (WebCore::Editor::applyParagraphStyle):
+        (WebCore::Editor::applyStyleToSelection):
+        (WebCore::Editor::applyParagraphStyleToSelection):
+        (WebCore::Editor::selectionStartHasStyle):
+        (WebCore::Editor::document):
+        (WebCore::Editor::styleForSelectionStart): Deleted.
+        * editing/Editor.h:
+        * editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
+        * editing/cocoa/EditorCocoa.mm: Added.
+        (WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
+        (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
+        fontAttributesForSelectionStart implementation.
+        * editing/cocoa/HTMLConverter.mm:
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::fontAttributesForSelectionStart):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::fontAttributesForSelectionStart):
+        * loader/EmptyClients.h:
+        * page/EditorClient.h:
+
 2015-06-29  Matt Rajca  <mrajca@apple.com>
 
         MediaSession: use a HashSet for the collection of participating elements
index a484c79..94145ef 100644 (file)
                9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */; };
                9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; };
                9B50B1DE17CD4C0F0087F63C /* FormNamedItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B50B1DC17CD4C0F0087F63C /* FormNamedItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               9B55EEE91B3E8898005342BC /* EditorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */; };
                9B6C41531344949000085B62 /* StringWithDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B6C41521344949000085B62 /* StringWithDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BA273F3172206BB0097CE47 /* LogicalSelectionOffsetCaches.h */; };
                9BAB6C6C12550631001626D4 /* EditingStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAB6C6A12550631001626D4 /* EditingStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9BAB6C6D12550631001626D4 /* EditingStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */; };
                9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAF3B2312C1A39800014BF1 /* WritingDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               9BB737651B41C03500AE13EB /* NSAttributedStringSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BB737641B41C03500AE13EB /* NSAttributedStringSPI.h */; };
                9BC6C21B13CCC97B008E0337 /* HTMLTextFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BC6C21913CCC97B008E0337 /* HTMLTextFormControlElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC6C21A13CCC97B008E0337 /* HTMLTextFormControlElement.cpp */; };
                9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */; };
                9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyBlockElementCommand.h; sourceTree = "<group>"; };
                9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; };
                9B50B1DC17CD4C0F0087F63C /* FormNamedItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormNamedItem.h; sourceTree = "<group>"; };
+               9B55EEE81B3E8898005342BC /* EditorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorCocoa.mm; sourceTree = "<group>"; };
+               9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EditorCocoa.h; sourceTree = "<group>"; };
                9B6C41521344949000085B62 /* StringWithDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringWithDirection.h; sourceTree = "<group>"; };
                9BA273F3172206BB0097CE47 /* LogicalSelectionOffsetCaches.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogicalSelectionOffsetCaches.h; sourceTree = "<group>"; };
                9BAB6C6A12550631001626D4 /* EditingStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingStyle.h; sourceTree = "<group>"; };
                9BAB6C6B12550631001626D4 /* EditingStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditingStyle.cpp; sourceTree = "<group>"; };
                9BAF3B2312C1A39800014BF1 /* WritingDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritingDirection.h; sourceTree = "<group>"; };
+               9BB737641B41C03500AE13EB /* NSAttributedStringSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAttributedStringSPI.h; sourceTree = "<group>"; };
                9BC6C21913CCC97B008E0337 /* HTMLTextFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTextFormControlElement.h; sourceTree = "<group>"; };
                9BC6C21A13CCC97B008E0337 /* HTMLTextFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTextFormControlElement.cpp; sourceTree = "<group>"; };
                9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopedEventQueue.h; sourceTree = "<group>"; };
                                44EFF6421A6FF92700D45EEC /* IOTypesSPI.h */,
                                CE12524E1A1A78D200864480 /* MachVMSPI.h */,
                                A19D93441A9FEC7200B46C24 /* NEFilterSourceSPI.h */,
+                               9BB737641B41C03500AE13EB /* NSAttributedStringSPI.h */,
                                CE1252501A1BEBD800864480 /* NSCalendarDateSPI.h */,
                                31DF63561AF187DD0078FD91 /* NSColorSPI.h */,
                                2DDB97F319F9AECA002025D8 /* NSExtensionSPI.h */,
                7C3E510718DF8F1200C112F7 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
+                               9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */,
+                               9B55EEE81B3E8898005342BC /* EditorCocoa.mm */,
                                7C3E510818DF8F3500C112F7 /* HTMLConverter.h */,
                                7C3E510918DF8F3500C112F7 /* HTMLConverter.mm */,
                        );
                                31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */,
                                85C7F5E70AAFBAFB004014DD /* DOMWheelEvent.h in Headers */,
                                85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */,
+                               9BB737651B41C03500AE13EB /* NSAttributedStringSPI.h in Headers */,
                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
                                FC9A0F75164094CF003D6B8D /* DOMWindowCSS.h in Headers */,
                                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
                                FE9E89FB16E2DC0500A908F8 /* OriginLock.cpp in Sources */,
                                FD581FAE1520F91F003A7A75 /* OscillatorNode.cpp in Sources */,
                                1A0D57360A5C77FE007EDD4C /* OverflowEvent.cpp in Sources */,
+                               9B55EEE91B3E8898005342BC /* EditorCocoa.mm in Sources */,
                                65FEA86909833ADE00BED4AB /* Page.cpp in Sources */,
                                1477E7760BF4134A00152872 /* PageCache.cpp in Sources */,
                                CD5E5B611A15F156000C609E /* PageConfiguration.cpp in Sources */,
index 9c49beb..a3c3c9c 100644 (file)
@@ -884,8 +884,7 @@ void Editor::applyStyle(StyleProperties* style, EditAction editingAction)
 {
     switch (m_frame.selection().selection().selectionType()) {
     case VisibleSelection::NoSelection:
-        // do nothing
-        break;
+        return;
     case VisibleSelection::CaretSelection:
         computeAndSetTypingStyle(EditingStyle::create(style), editingAction);
         break;
@@ -894,14 +893,14 @@ void Editor::applyStyle(StyleProperties* style, EditAction editingAction)
             applyCommand(ApplyStyleCommand::create(document(), EditingStyle::create(style).ptr(), editingAction));
         break;
     }
+    client()->didApplyStyle();
 }
 
 void Editor::applyStyle(RefPtr<EditingStyle>&& style, EditAction editingAction)
 {
     switch (m_frame.selection().selection().selectionType()) {
     case VisibleSelection::NoSelection:
-        // do nothing
-        break;
+        return;
     case VisibleSelection::CaretSelection:
         computeAndSetTypingStyle(*style, editingAction);
         break;
@@ -910,6 +909,7 @@ void Editor::applyStyle(RefPtr<EditingStyle>&& style, EditAction editingAction)
             applyCommand(ApplyStyleCommand::create(document(), style.get(), editingAction));
         break;
     }
+    client()->didApplyStyle();
 }
     
 bool Editor::shouldApplyStyle(StyleProperties* style, Range* range)
@@ -921,14 +921,14 @@ void Editor::applyParagraphStyle(StyleProperties* style, EditAction editingActio
 {
     switch (m_frame.selection().selection().selectionType()) {
     case VisibleSelection::NoSelection:
-        // do nothing
-        break;
+        return;
     case VisibleSelection::CaretSelection:
     case VisibleSelection::RangeSelection:
         if (style)
             applyCommand(ApplyStyleCommand::create(document(), EditingStyle::create(style).ptr(), editingAction, ApplyStyleCommand::ForceBlockProperties));
         break;
     }
+    client()->didApplyStyle();
 }
 
 void Editor::applyStyleToSelection(StyleProperties* style, EditAction editingAction)
@@ -3568,37 +3568,4 @@ Document& Editor::document() const
     return *m_frame.document();
 }
 
-#if PLATFORM(COCOA)
-// FIXME: This figures out the current style by inserting a <span>!
-RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node *&nodeToRemove)
-{
-    nodeToRemove = nullptr;
-
-    if (frame->selection().isNone())
-        return nullptr;
-
-    Position position = frame->selection().selection().visibleStart().deepEquivalent();
-    if (!position.isCandidate() || position.isNull())
-        return nullptr;
-
-    RefPtr<EditingStyle> typingStyle = frame->selection().typingStyle();
-    if (!typingStyle || !typingStyle->style())
-        return &position.deprecatedNode()->renderer()->style();
-
-    RefPtr<Element> styleElement = frame->document()->createElement(spanTag, false);
-
-    String styleText = typingStyle->style()->asText() + " display: inline";
-    styleElement->setAttribute(styleAttr, styleText);
-
-    styleElement->appendChild(frame->document()->createEditingTextNode(""), ASSERT_NO_EXCEPTION);
-
-    position.deprecatedNode()->parentNode()->appendChild(styleElement, ASSERT_NO_EXCEPTION);
-
-    nodeToRemove = styleElement.get();
-
-    frame->document()->updateStyleIfNeeded();
-    return styleElement->renderer() ? &styleElement->renderer()->style() : nullptr;
-}
-#endif
-
 } // namespace WebCore
index 18ce29e..9eb04f0 100644 (file)
@@ -45,6 +45,7 @@
 #if PLATFORM(COCOA)
 OBJC_CLASS NSAttributedString;
 OBJC_CLASS NSDictionary;
+OBJC_CLASS NSMutableDictionary;
 #endif
 
 namespace WebCore {
@@ -424,6 +425,7 @@ public:
 
 #if PLATFORM(COCOA)
     WEBCORE_EXPORT static RenderStyle* styleForSelectionStart(Frame* , Node *&nodeToRemove);
+    void getTextDecorationAttributesRespectingTypingStyle(RenderStyle&, NSMutableDictionary*) const;
     WEBCORE_EXPORT bool insertParagraphSeparatorInQuotedContent();
     WEBCORE_EXPORT const Font* fontForSelection(bool&) const;
     WEBCORE_EXPORT NSDictionary *fontAttributesForSelectionStart() const;
diff --git a/Source/WebCore/editing/cocoa/EditorCocoa.h b/Source/WebCore/editing/cocoa/EditorCocoa.h
new file mode 100644 (file)
index 0000000..a12a5d6
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2013, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EditorCocoa_h
+#define EditorCocoa_h
+
+#include "Editor.h"
+
+#if PLATFORM(IOS)
+
+typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
+    NSUnderlineStyleNone                                = 0x00,
+    NSUnderlineStyleSingle                              = 0x01,
+    NSUnderlineStyleThick NS_ENUM_AVAILABLE_IOS(7_0)    = 0x02,
+    NSUnderlineStyleDouble NS_ENUM_AVAILABLE_IOS(7_0)   = 0x09,
+    
+    NSUnderlinePatternSolid NS_ENUM_AVAILABLE_IOS(7_0)      = 0x0000,
+    NSUnderlinePatternDot NS_ENUM_AVAILABLE_IOS(7_0)        = 0x0100,
+    NSUnderlinePatternDash NS_ENUM_AVAILABLE_IOS(7_0)       = 0x0200,
+    NSUnderlinePatternDashDot NS_ENUM_AVAILABLE_IOS(7_0)    = 0x0300,
+    NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0400,
+    
+    NSUnderlineByWord NS_ENUM_AVAILABLE_IOS(7_0) = 0x8000
+};
+
+#endif
+
+#endif
diff --git a/Source/WebCore/editing/cocoa/EditorCocoa.mm b/Source/WebCore/editing/cocoa/EditorCocoa.mm
new file mode 100644 (file)
index 0000000..48dccf1
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2013, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "Editor.h"
+
+#import "CSSValueList.h"
+#import "CSSValuePool.h"
+#import "EditingStyle.h"
+#import "Frame.h"
+#import "FrameSelection.h"
+#import "NSAttributedStringSPI.h"
+#import "RenderElement.h"
+#import "RenderStyle.h"
+#import "SoftLinking.h"
+#import "Text.h"
+
+namespace WebCore {
+
+// FIXME: This figures out the current style by inserting a <span>!
+RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node *&nodeToRemove)
+{
+    nodeToRemove = nullptr;
+    
+    if (frame->selection().isNone())
+        return nullptr;
+
+    Position position = frame->selection().selection().visibleStart().deepEquivalent();
+    if (!position.isCandidate() || position.isNull())
+        return nullptr;
+
+    RefPtr<EditingStyle> typingStyle = frame->selection().typingStyle();
+    if (!typingStyle || !typingStyle->style())
+        return &position.deprecatedNode()->renderer()->style();
+
+    RefPtr<Element> styleElement = frame->document()->createElement(HTMLNames::spanTag, false);
+
+    String styleText = typingStyle->style()->asText() + " display: inline";
+    styleElement->setAttribute(HTMLNames::styleAttr, styleText);
+
+    styleElement->appendChild(frame->document()->createEditingTextNode(""), ASSERT_NO_EXCEPTION);
+
+    position.deprecatedNode()->parentNode()->appendChild(styleElement, ASSERT_NO_EXCEPTION);
+
+    nodeToRemove = styleElement.get();
+
+    frame->document()->updateStyleIfNeeded();
+    return styleElement->renderer() ? &styleElement->renderer()->style() : nullptr;
+}
+
+void Editor::getTextDecorationAttributesRespectingTypingStyle(RenderStyle& style, NSMutableDictionary* result) const
+{
+    RefPtr<EditingStyle> typingStyle = m_frame.selection().typingStyle();
+    if (typingStyle && typingStyle->style()) {
+        RefPtr<CSSValue> value = typingStyle->style()->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
+        if (value && value->isValueList()) {
+            CSSValueList& valueList = downcast<CSSValueList>(*value);
+            if (valueList.hasValue(cssValuePool().createIdentifierValue(CSSValueLineThrough).ptr()))
+                [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
+            if (valueList.hasValue(cssValuePool().createIdentifierValue(CSSValueUnderline).ptr()))
+                [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
+        }
+    } else {
+        int decoration = style.textDecorationsInEffect();
+        if (decoration & TextDecorationLineThrough)
+            [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
+        if (decoration & TextDecorationUnderline)
+            [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
+    }
+}
+
+}
index 23bb5da..bb704c5 100644 (file)
@@ -53,6 +53,7 @@
 #import "HTMLTableCellElement.h"
 #import "HTMLTextAreaElement.h"
 #import "LoaderNSURLExtras.h"
+#import "NSAttributedStringSPI.h"
 #import "RGBColor.h"
 #import "RenderImage.h"
 #import "SoftLinking.h"
@@ -194,21 +195,6 @@ typedef enum {
     UIFontTraitUltraLight  = (1 << 4)
 } UIFontTrait;
 
-typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
-    NSUnderlineStyleNone                                = 0x00,
-    NSUnderlineStyleSingle                              = 0x01,
-    NSUnderlineStyleThick NS_ENUM_AVAILABLE_IOS(7_0)    = 0x02,
-    NSUnderlineStyleDouble NS_ENUM_AVAILABLE_IOS(7_0)   = 0x09,
-
-    NSUnderlinePatternSolid NS_ENUM_AVAILABLE_IOS(7_0)      = 0x0000,
-    NSUnderlinePatternDot NS_ENUM_AVAILABLE_IOS(7_0)        = 0x0100,
-    NSUnderlinePatternDash NS_ENUM_AVAILABLE_IOS(7_0)       = 0x0200,
-    NSUnderlinePatternDashDot NS_ENUM_AVAILABLE_IOS(7_0)    = 0x0300,
-    NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0400,
-
-    NSUnderlineByWord NS_ENUM_AVAILABLE_IOS(7_0) = 0x8000
-};
-
 enum {
     NSTextBlockAbsoluteValueType    = 0,    // Absolute value in points
     NSTextBlockPercentageValueType  = 1     // Percentage value (out of 100)
index 3ba0d81..226ead5 100644 (file)
@@ -44,6 +44,7 @@
 #include "HTMLParserIdioms.h"
 #include "HTMLTextAreaElement.h"
 #include "LegacyWebArchive.h"
+#include "NSAttributedStringSPI.h"
 #include "NodeTraversal.h"
 #include "Page.h"
 #include "Pasteboard.h"
@@ -77,12 +78,6 @@ SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassMIMEType, CFStringRef)
 #define kUTTagClassFilenameExtension getkUTTagClassFilenameExtension()
 #define kUTTagClassMIMEType getkUTTagClassMIMEType()
 
-SOFT_LINK_PRIVATE_FRAMEWORK(UIFoundation)
-SOFT_LINK_CONSTANT(UIFoundation, NSFontAttributeName, NSString *)
-#define NSFontAttributeName getNSFontAttributeName()
-SOFT_LINK_CONSTANT(UIFoundation, NSUnderlineStyleAttributeName, NSString *)
-#define NSUnderlineStyleAttributeName getNSUnderlineStyleAttributeName()
-
 @interface NSAttributedString (NSAttributedStringKitAdditions)
 - (id)initWithRTF:(NSData *)data documentAttributes:(NSDictionary **)dict;
 - (id)initWithRTFD:(NSData *)data documentAttributes:(NSDictionary **)dict;
@@ -91,21 +86,6 @@ SOFT_LINK_CONSTANT(UIFoundation, NSUnderlineStyleAttributeName, NSString *)
 - (BOOL)containsAttachments;
 @end
 
-typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
-    NSUnderlineStyleNone                                = 0x00,
-    NSUnderlineStyleSingle                              = 0x01,
-    NSUnderlineStyleThick NS_ENUM_AVAILABLE_IOS(7_0)    = 0x02,
-    NSUnderlineStyleDouble NS_ENUM_AVAILABLE_IOS(7_0)   = 0x09,
-    
-    NSUnderlinePatternSolid NS_ENUM_AVAILABLE_IOS(7_0)      = 0x0000,
-    NSUnderlinePatternDot NS_ENUM_AVAILABLE_IOS(7_0)        = 0x0100,
-    NSUnderlinePatternDash NS_ENUM_AVAILABLE_IOS(7_0)       = 0x0200,
-    NSUnderlinePatternDashDot NS_ENUM_AVAILABLE_IOS(7_0)    = 0x0300,
-    NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0400,
-    
-    NSUnderlineByWord NS_ENUM_AVAILABLE_IOS(7_0) = 0x8000
-};
-
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -261,15 +241,8 @@ NSDictionary* Editor::fontAttributesForSelectionStart() const
     if (font)
         [result setObject:(id)font forKey:NSFontAttributeName];
 
-    RefPtr<EditingStyle> typingStyle = m_frame.selection().typingStyle();
-    if (typingStyle && typingStyle->style()) {
-        String value = typingStyle->style()->getPropertyValue(CSSPropertyWebkitTextDecorationsInEffect);
-        if (value.contains("underline"))
-            [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
-    } else {
-        if (style->textDecorationsInEffect() & TextDecorationUnderline)
-            [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
-    }
+    getTextDecorationAttributesRespectingTypingStyle(*style, result);
+
     if (nodeToRemove)
         nodeToRemove->remove(ASSERT_NO_EXCEPTION);
     
index 725af4c..5c0bdaa 100644 (file)
@@ -179,10 +179,6 @@ NSDictionary* Editor::fontAttributesForSelectionStart() const
         [result setObject:s.get() forKey:NSShadowAttributeName];
     }
 
-    int decoration = style->textDecorationsInEffect();
-    if (decoration & TextDecorationLineThrough)
-        [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
-
     int superscriptInt = 0;
     switch (style->verticalAlign()) {
         case BASELINE:
@@ -204,8 +200,7 @@ NSDictionary* Editor::fontAttributesForSelectionStart() const
     if (superscriptInt)
         [result setObject:[NSNumber numberWithInt:superscriptInt] forKey:NSSuperscriptAttributeName];
 
-    if (decoration & TextDecorationUnderline)
-        [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
+    getTextDecorationAttributesRespectingTypingStyle(*style, result);
 
     if (nodeToRemove)
         nodeToRemove->remove(ASSERT_NO_EXCEPTION);
index 1310de2..5381203 100644 (file)
@@ -442,6 +442,7 @@ public:
     virtual bool shouldChangeSelectedRange(Range*, Range*, EAffinity, bool) override { return false; }
 
     virtual bool shouldApplyStyle(StyleProperties*, Range*) override { return false; }
+    virtual void didApplyStyle() override { }
     virtual bool shouldMoveRangeAfterDelete(Range*, Range*) override { return false; }
 
     virtual void didBeginEditing() override { }
index 2d551c7..3c53a53 100644 (file)
@@ -88,6 +88,7 @@ public:
     virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) = 0;
     
     virtual bool shouldApplyStyle(StyleProperties*, Range*) = 0;
+    virtual void didApplyStyle() = 0;
     virtual bool shouldMoveRangeAfterDelete(Range*, Range*) = 0;
 
     virtual void didBeginEditing() = 0;
diff --git a/Source/WebCore/platform/spi/cocoa/NSAttributedStringSPI.h b/Source/WebCore/platform/spi/cocoa/NSAttributedStringSPI.h
new file mode 100644 (file)
index 0000000..d85e8b5
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NSAttributedStringSPI_h
+#define NSAttributedStringSPI_h
+
+#import "SoftLinking.h"
+
+#if PLATFORM(IOS)
+
+typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
+    NSUnderlineStyleNone                                = 0x00,
+    NSUnderlineStyleSingle                              = 0x01,
+    NSUnderlineStyleThick NS_ENUM_AVAILABLE_IOS(7_0)    = 0x02,
+    NSUnderlineStyleDouble NS_ENUM_AVAILABLE_IOS(7_0)   = 0x09,
+    
+    NSUnderlinePatternSolid NS_ENUM_AVAILABLE_IOS(7_0)      = 0x0000,
+    NSUnderlinePatternDot NS_ENUM_AVAILABLE_IOS(7_0)        = 0x0100,
+    NSUnderlinePatternDash NS_ENUM_AVAILABLE_IOS(7_0)       = 0x0200,
+    NSUnderlinePatternDashDot NS_ENUM_AVAILABLE_IOS(7_0)    = 0x0300,
+    NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0400,
+    
+    NSUnderlineByWord NS_ENUM_AVAILABLE_IOS(7_0) = 0x8000
+};
+
+SOFT_LINK_PRIVATE_FRAMEWORK(UIFoundation)
+
+SOFT_LINK_CONSTANT(UIFoundation, NSUnderlineStyleAttributeName, NSString *)
+#define NSUnderlineStyleAttributeName getNSUnderlineStyleAttributeName()
+SOFT_LINK_CONSTANT(UIFoundation, NSStrikethroughStyleAttributeName, NSString *)
+#define NSStrikethroughStyleAttributeName getNSStrikethroughStyleAttributeName()
+
+#endif
+
+#endif
index 94b5c61..12faaee 100644 (file)
@@ -1,3 +1,22 @@
+2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=146379
+
+        Reviewed by Darin Adler.
+
+        Update the font panel when newly added EditorClient::didApplyStyle is called. Also set the font attributes
+        in _updateFontPanel so that underline and strike through states will be reflected.
+
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::shouldApplyStyle):
+        (updateFontPanelIfNeeded): Extracted from respondToChangedContents.
+        (WebEditorClient::didApplyStyle): Added.
+        (WebEditorClient::respondToChangedContents):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _updateFontPanel]): Sets font attributes as well as font.
+
 2015-06-29  Dean Jackson  <dino@apple.com>
 
         Setting to enable/disable media controls sizing on page zoom
index 6478038..46fd709 100644 (file)
@@ -69,7 +69,8 @@ private:
     virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) override;
 
     virtual bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) override;
-    
+    virtual void didApplyStyle() override;
+
     virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range* rangeToBeReplaced) override;
 
     virtual void didBeginEditing() override;
index 7cb61cd..6ced194 100644 (file)
@@ -258,6 +258,22 @@ bool WebEditorClient::shouldApplyStyle(StyleProperties* style, Range* range)
         shouldApplyStyle:kit(mutableStyle->ensureCSSStyleDeclaration()) toElementsInDOMRange:kit(range)];
 }
 
+static void updateFontPanel(WebView *webView)
+{
+#if !PLATFORM(IOS)
+    NSView <WebDocumentView> *view = [[[webView selectedFrame] frameView] documentView];
+    if ([view isKindOfClass:[WebHTMLView class]])
+        [(WebHTMLView *)view _updateFontPanel];
+#else
+    UNUSED_PARAM(webView);
+#endif
+}
+
+void WebEditorClient::didApplyStyle()
+{
+    updateFontPanel(m_webView);
+}
+
 bool WebEditorClient::shouldMoveRangeAfterDelete(Range* range, Range* rangeToBeReplaced)
 {
     return [[m_webView _editingDelegateForwarder] webView:m_webView
@@ -317,10 +333,8 @@ void WebEditorClient::stopDelayingAndCoalescingContentChangeNotifications()
 
 void WebEditorClient::respondToChangedContents()
 {
+    updateFontPanel(m_webView);
 #if !PLATFORM(IOS)
-    NSView <WebDocumentView> *view = [[[m_webView selectedFrame] frameView] documentView];
-    if ([view isKindOfClass:[WebHTMLView class]])
-        [(WebHTMLView *)view _updateFontPanel];
     [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeNotification object:m_webView];    
 #else
     if (m_delayingContentChangeNotifications) {
index d95acf5..17e046c 100644 (file)
@@ -5482,9 +5482,11 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
     bool multipleFonts = false;
     NSFont *font = nil;
+    NSDictionary *attributes = nil;
     if (Frame* coreFrame = core([self _frame])) {
         if (const Font* fd = coreFrame->editor().fontForSelection(multipleFonts))
             font = fd->getNSFont();
+        attributes = coreFrame->editor().fontAttributesForSelectionStart();
     }
 
     // FIXME: for now, return a bogus font that distinguishes the empty selection from the non-empty
@@ -5493,7 +5495,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
         font = [self _hasSelection] ? [NSFont menuFontOfSize:23] : [NSFont toolTipsFontOfSize:17];
     ASSERT(font != nil);
 
-    [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:multipleFonts];
+    NSFontManager *fontManager = [NSFontManager sharedFontManager];
+    [fontManager setSelectedFont:font isMultiple:multipleFonts];
+    [fontManager setSelectedAttributes:(attributes ? attributes : @{ }) isMultiple:multipleFonts];
 }
 #endif
 
index 6a08563..1612de7 100644 (file)
@@ -1,3 +1,14 @@
+2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=146379
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebEditorClient.cpp:
+        (WebEditorClient::didApplyStyle): Added.
+        * WebCoreSupport/WebEditorClient.h:
+
 2015-06-26  Per Arne Vollan  <peavo@outlook.com>
 
         WinLauncher fails to download files.
index c79334b..59043b7 100644 (file)
@@ -339,14 +339,28 @@ bool WebEditorClient::shouldChangeSelectedRange(WebCore::Range* currentRange, We
     return shouldChange;
 }
 
-bool WebEditorClient::shouldApplyStyle(StyleProperties* /*style*/, Range* /*toElementsInDOMRange*/)
-{ notImplemented(); return true; }
+bool WebEditorClient::shouldApplyStyle(StyleProperties*, Range*)
+{
+    notImplemented();
+    return true;
+}
 
-bool WebEditorClient::shouldMoveRangeAfterDelete(Range* /*range*/, Range* /*rangeToBeReplaced*/)
-{ notImplemented(); return true; }
+void WebEditorClient::didApplyStyle(StyleProperties*, Range*)
+{
+    notImplemented();
+}
 
-bool WebEditorClient::shouldChangeTypingStyle(StyleProperties* /*currentStyle*/, StyleProperties* /*toProposedStyle*/)
-{ notImplemented(); return false; }
+bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*)
+{
+    notImplemented();
+    return true;
+}
+
+bool WebEditorClient::shouldChangeTypingStyle(StyleProperties*, StyleProperties*)
+{
+    notImplemented();
+    return false;
+}
 
 void WebEditorClient::webViewDidChangeTypingStyle(WebNotification* /*notification*/)
 {
index 96af1b6..843078f 100644 (file)
@@ -66,6 +66,7 @@ public:
 
     bool shouldInsertNode(WebCore::Node*, WebCore::Range* replacingRange, WebCore::EditorInsertAction);
     bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*);
+    void didApplyStyle(WebCore::StyleProperties*, WebCore::Range*);
     bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*);
     bool shouldChangeTypingStyle(WebCore::StyleProperties* currentStyle, WebCore::StyleProperties* toProposedStyle);
 
index f49945a..a8d6394 100644 (file)
@@ -1,3 +1,17 @@
+2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=146379
+
+        Reviewed by Darin Adler.
+
+        Since font panel doesn't open in WebKit2 at the moment, just add an empty implementation of didApplyStyle
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::didApplyStyle):
+        * WebProcess/WebCoreSupport/WebEditorClient.h:
+        * WebProcess/WebPage/WebPage.h:
+
 2015-06-29  Dean Jackson  <dino@apple.com>
 
         Setting to enable/disable media controls sizing on page zoom
index b8cbcce..80f0920 100644 (file)
@@ -155,6 +155,11 @@ bool WebEditorClient::shouldApplyStyle(StyleProperties* style, Range* range)
     return result;
 }
 
+void WebEditorClient::didApplyStyle()
+{
+    notImplemented();
+}
+
 bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*)
 {
     notImplemented();
index 7705519..395347a 100644 (file)
@@ -59,6 +59,7 @@ private:
     virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) override;
     
     virtual bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) override;
+    virtual void didApplyStyle() override;
     virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) override;
 
     virtual void didBeginEditing() override;
index e344877..1d76400 100644 (file)
@@ -615,6 +615,7 @@ public:
     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
 #endif
 
+    void didApplyStyle();
     void didChangeSelection();
     void discardedComposition();