https://bugs.webkit.org/show_bug.cgi?id=78939
Reviewed by Enrica Casucci.
Source/WebCore:
Changed the argument types of shouldApplyStyle, applyParagraphStyle, applyStyleToSelection,
applyParagraphStyleToSelection, and computeAndSetTypingStyle in Editor from CSSStyleDeclaration
to StylePropertySet.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::applyStyle):
(WebCore::Editor::shouldApplyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::applyStyleToSelection):
(WebCore::Editor::applyParagraphStyleToSelection):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/Editor.h:
(WebCore):
(Editor):
* editing/EditorCommand.cpp:
(WebCore::applyCommandToFrame):
(WebCore::executeApplyParagraphStyle):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
* loader/EmptyClients.h:
(WebCore::EmptyEditorClient::shouldApplyStyle):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/EditorClient.h:
(WebCore):
(EditorClient):
Source/WebKit/blackberry:
* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::shouldApplyStyle):
* WebCoreSupport/EditorClientBlackBerry.h:
(EditorClientBlackBerry):
Source/WebKit/chromium:
* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::shouldApplyStyle):
* src/EditorClientImpl.h:
(EditorClientImpl):
Source/WebKit/efl:
* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::shouldApplyStyle):
* WebCoreSupport/EditorClientEfl.h:
(EditorClientEfl):
Source/WebKit/gtk:
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::shouldApplyStyle):
* WebCoreSupport/EditorClientGtk.h:
(EditorClient):
Source/WebKit/mac:
* WebCoreSupport/WebEditorClient.h:
(WebEditorClient):
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::shouldApplyStyle):
* WebView/WebFrame.mm:
(-[WebFrame _setTypingStyle:withUndoAction:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
(-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
* WebView/WebView.mm:
(-[WebView applyStyle:]):
Source/WebKit/qt:
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::shouldApplyStyle):
* WebCoreSupport/EditorClientQt.h:
(EditorClientQt):
Source/WebKit/win:
* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::shouldApplyStyle):
* WebCoreSupport/WebEditorClient.h:
(WebEditorClient):
Source/WebKit/wince:
* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::shouldApplyStyle):
Source/WebKit/wx:
* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::shouldApplyStyle):
* WebKitSupport/EditorClientWx.h:
(EditorClientWx):
Source/WebKit2:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldApplyStyle):
* WebProcess/WebCoreSupport/WebEditorClient.h:
(WebEditorClient):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108462
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ Changed the argument types of shouldApplyStyle, applyParagraphStyle, applyStyleToSelection,
+ applyParagraphStyleToSelection, and computeAndSetTypingStyle in Editor from CSSStyleDeclaration
+ to StylePropertySet.
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/Editor.cpp:
+ (WebCore::Editor::applyStyle):
+ (WebCore::Editor::shouldApplyStyle):
+ (WebCore::Editor::applyParagraphStyle):
+ (WebCore::Editor::applyStyleToSelection):
+ (WebCore::Editor::applyParagraphStyleToSelection):
+ (WebCore::Editor::setBaseWritingDirection):
+ (WebCore::Editor::computeAndSetTypingStyle):
+ * editing/Editor.h:
+ (WebCore):
+ (Editor):
+ * editing/EditorCommand.cpp:
+ (WebCore::applyCommandToFrame):
+ (WebCore::executeApplyParagraphStyle):
+ (WebCore::executeMakeTextWritingDirectionLeftToRight):
+ (WebCore::executeMakeTextWritingDirectionNatural):
+ (WebCore::executeMakeTextWritingDirectionRightToLeft):
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::shouldApplyStyle):
+ * page/DragController.cpp:
+ (WebCore::DragController::concludeEditDrag):
+ * page/EditorClient.h:
+ (WebCore):
+ (EditorClient):
+
2012-02-22 Dana Jansens <danakj@chromium.org>
[chromium] Cull quads outside of the scissoring damage rect
__ZN7WebCore6CursorC1EPNS_5ImageERKNS_8IntPointE
__ZN7WebCore6CursorD1Ev
__ZN7WebCore6CursoraSERKS0_
-__ZN7WebCore6Editor10applyStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
+__ZN7WebCore6Editor10applyStyleEPNS_16StylePropertySetENS_10EditActionE
__ZN7WebCore6Editor10findStringERKN3WTF6StringEj
__ZN7WebCore6Editor10insertTextERKN3WTF6StringEPNS_5EventE
__ZN7WebCore6Editor13canDHTMLPasteEv
__ZN7WebCore6Editor19countMatchesForTextERKN3WTF6StringEPNS_5RangeEjjb
__ZN7WebCore6Editor19deleteWithDirectionENS_18SelectionDirectionENS_15TextGranularityEbb
__ZN7WebCore6Editor19insertUnorderedListEv
-__ZN7WebCore6Editor21applyStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
+__ZN7WebCore6Editor21applyStyleToSelectionEPNS_16StylePropertySetENS_10EditActionE
__ZN7WebCore6Editor21isSelectionMisspelledEv
__ZN7WebCore6Editor23setBaseWritingDirectionE16WritingDirection
__ZN7WebCore6Editor24advanceToNextMisspellingEb
-__ZN7WebCore6Editor24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
+__ZN7WebCore6Editor24computeAndSetTypingStyleEPNS_16StylePropertySetENS_10EditActionE
__ZN7WebCore6Editor24isSelectionUngrammaticalEv
__ZN7WebCore6Editor24replaceSelectionWithTextERKN3WTF6StringEbb
__ZN7WebCore6Editor26decreaseSelectionListLevelEv
__ZN7WebCore6Editor28replaceSelectionWithFragmentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbb
__ZN7WebCore6Editor29canDecreaseSelectionListLevelEv
__ZN7WebCore6Editor29canIncreaseSelectionListLevelEv
-__ZN7WebCore6Editor30applyParagraphStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
__ZN7WebCore6Editor30pasteAsPlainTextBypassingDHTMLEv
__ZN7WebCore6Editor32guessesForUngrammaticalSelectionEv
return findEventTargetFrom(m_frame->selection()->selection());
}
-void Editor::applyStyle(CSSStyleDeclaration* style, EditAction editingAction)
+void Editor::applyStyle(StylePropertySet* style, EditAction editingAction)
{
switch (m_frame->selection()->selectionType()) {
case VisibleSelection::NoSelection:
}
}
-bool Editor::shouldApplyStyle(CSSStyleDeclaration* style, Range* range)
+bool Editor::shouldApplyStyle(StylePropertySet* style, Range* range)
{
return client()->shouldApplyStyle(style, range);
}
-void Editor::applyParagraphStyle(CSSStyleDeclaration* style, EditAction editingAction)
+void Editor::applyParagraphStyle(StylePropertySet* style, EditAction editingAction)
{
switch (m_frame->selection()->selectionType()) {
case VisibleSelection::NoSelection:
}
}
-void Editor::applyStyleToSelection(CSSStyleDeclaration* style, EditAction editingAction)
+void Editor::applyStyleToSelection(StylePropertySet* style, EditAction editingAction)
{
- if (!style || !style->length() || !canEditRichly())
+ if (!style || style->isEmpty() || !canEditRichly())
return;
if (client() && client()->shouldApplyStyle(style, m_frame->selection()->toNormalizedRange().get()))
applyStyle(style, editingAction);
}
-void Editor::applyParagraphStyleToSelection(CSSStyleDeclaration* style, EditAction editingAction)
+void Editor::applyParagraphStyleToSelection(StylePropertySet* style, EditAction editingAction)
{
- if (!style || !style->length() || !canEditRichly())
+ if (!style || style->isEmpty() || !canEditRichly())
return;
if (client() && client()->shouldApplyStyle(style, m_frame->selection()->toNormalizedRange().get()))
RefPtr<StylePropertySet> style = StylePropertySet::create();
style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDirection ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", false);
- applyParagraphStyleToSelection(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
+ applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection);
}
void Editor::selectComposition()
return client() && client()->shouldChangeSelectedRange(oldSelection.toNormalizedRange().get(), newSelection.toNormalizedRange().get(), affinity, stillSelecting);
}
-void Editor::computeAndSetTypingStyle(CSSStyleDeclaration* style, EditAction editingAction)
+void Editor::computeAndSetTypingStyle(StylePropertySet* style, EditAction editingAction)
{
- if (!style || !style->length()) {
+ if (!style || style->isEmpty()) {
m_frame->selection()->clearTypingStyle();
return;
}
RefPtr<EditingStyle> typingStyle;
if (m_frame->selection()->typingStyle()) {
typingStyle = m_frame->selection()->typingStyle()->copy();
- typingStyle->overrideWithStyle(style->makeMutable().get());
+ typingStyle->overrideWithStyle(style);
} else
typingStyle = EditingStyle::create(style);
namespace WebCore {
-class CSSStyleDeclaration;
class Clipboard;
class CompositeEditCommand;
class DeleteButtonController;
class SpellChecker;
class SpellCheckRequest;
class SpellingCorrectionController;
+class StylePropertySet;
class Text;
class TextCheckerClient;
class TextEvent;
bool shouldInsertText(const String&, Range*, EditorInsertAction) const;
bool shouldShowDeleteInterface(HTMLElement*) const;
bool shouldDeleteRange(Range*) const;
- bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+ bool shouldApplyStyle(StylePropertySet*, Range*);
void respondToChangedSelection(const VisibleSelection& oldSelection);
void respondToChangedContents(const VisibleSelection& endingSelection);
Node* removedAnchor() const { return m_removedAnchor.get(); }
void setRemovedAnchor(PassRefPtr<Node> n) { m_removedAnchor = n; }
- void applyStyle(CSSStyleDeclaration*, EditAction = EditActionUnspecified);
- void applyParagraphStyle(CSSStyleDeclaration*, EditAction = EditActionUnspecified);
- void applyStyleToSelection(CSSStyleDeclaration*, EditAction);
- void applyParagraphStyleToSelection(CSSStyleDeclaration*, EditAction);
+ void applyStyle(StylePropertySet*, EditAction = EditActionUnspecified);
+ void applyParagraphStyle(StylePropertySet*, EditAction = EditActionUnspecified);
+ void applyStyleToSelection(StylePropertySet*, EditAction);
+ void applyParagraphStyleToSelection(StylePropertySet*, EditAction);
void appliedEditing(PassRefPtr<CompositeEditCommand>);
void unappliedEditing(PassRefPtr<EditCommandComposition>);
const VisibleSelection& mark() const; // Mark, to be used as emacs uses it.
void setMark(const VisibleSelection&);
- void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
+ void computeAndSetTypingStyle(StylePropertySet* , EditAction = EditActionUnspecified);
void applyEditingStyleToBodyElement() const;
void applyEditingStyleToElement(Element*) const;
// FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that?
switch (source) {
case CommandFromMenuOrKeyBinding:
- frame->editor()->applyStyleToSelection(style->ensureCSSStyleDeclaration(), action);
+ frame->editor()->applyStyleToSelection(style, action);
return true;
case CommandFromDOM:
case CommandFromDOMWithUserInterface:
- frame->editor()->applyStyle(style->ensureCSSStyleDeclaration());
+ frame->editor()->applyStyle(style);
return true;
}
ASSERT_NOT_REACHED();
// FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that?
switch (source) {
case CommandFromMenuOrKeyBinding:
- frame->editor()->applyParagraphStyleToSelection(style->ensureCSSStyleDeclaration(), action);
+ frame->editor()->applyParagraphStyleToSelection(style.get(), action);
return true;
case CommandFromDOM:
case CommandFromDOMWithUserInterface:
- frame->editor()->applyParagraphStyle(style->ensureCSSStyleDeclaration());
+ frame->editor()->applyParagraphStyle(style.get());
return true;
}
ASSERT_NOT_REACHED();
RefPtr<StylePropertySet> style = StylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
style->setProperty(CSSPropertyDirection, CSSValueLtr);
- frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
+ frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
return true;
}
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
- frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
+ frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
return true;
}
RefPtr<StylePropertySet> style = StylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
style->setProperty(CSSPropertyDirection, CSSValueRtl);
- frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
+ frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
return true;
}
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) { return false; }
virtual bool shouldChangeSelectedRange(Range*, Range*, EAffinity, bool) { return false; }
- virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*) { return false; }
+ virtual bool shouldApplyStyle(StylePropertySet*, Range*) { return false; }
virtual bool shouldMoveRangeAfterDelete(Range*, Range*) { return false; }
virtual void didBeginEditing() { }
RefPtr<Range> innerRange = innerFrame->selection()->toNormalizedRange();
RefPtr<StylePropertySet> style = StylePropertySet::create();
style->setProperty(CSSPropertyColor, color.serialized(), false);
- if (!innerFrame->editor()->shouldApplyStyle(style->ensureCSSStyleDeclaration(), innerRange.get()))
+ if (!innerFrame->editor()->shouldApplyStyle(style.get(), innerRange.get()))
return false;
m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
- innerFrame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetColor);
+ innerFrame->editor()->applyStyle(style.get(), EditActionSetColor);
return true;
}
namespace WebCore {
class ArchiveResource;
-class CSSStyleDeclaration;
class DocumentFragment;
class Editor;
class Element;
class Node;
class Range;
class SpellChecker;
+class StylePropertySet;
class TextCheckerClient;
class VisibleSelection;
class VisiblePosition;
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) = 0;
virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) = 0;
- virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*) = 0;
+ virtual bool shouldApplyStyle(StylePropertySet*, Range*) = 0;
virtual bool shouldMoveRangeAfterDelete(Range*, Range*) = 0;
virtual void didBeginEditing() = 0;
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/EditorClientBlackBerry.cpp:
+ (WebCore::EditorClientBlackBerry::shouldApplyStyle):
+ * WebCoreSupport/EditorClientBlackBerry.h:
+ (EditorClientBlackBerry):
+
2012-02-18 Antonio Gomes <agomes@rim.com>
Fat fingers - cache the first rect-based hit test so we do not need to do it again
return true;
}
-bool EditorClientBlackBerry::shouldApplyStyle(CSSStyleDeclaration*, Range*)
+bool EditorClientBlackBerry::shouldApplyStyle(StylePropertySet*, Range*)
{
notImplemented();
return true;
virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
virtual bool shouldChangeSelectedRange(Range*, Range*, EAffinity, bool);
- virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+ virtual bool shouldApplyStyle(StylePropertySet*, Range*);
virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
virtual void didBeginEditing();
virtual void respondToChangedContents();
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::shouldApplyStyle):
+ * src/EditorClientImpl.h:
+ (EditorClientImpl):
+
2012-02-22 Dana Jansens <danakj@chromium.org>
[chromium] Cull quads outside of the scissoring damage rect
return true;
}
-bool EditorClientImpl::shouldApplyStyle(CSSStyleDeclaration* style,
- Range* range)
+bool EditorClientImpl::shouldApplyStyle(StylePropertySet* style, Range* range)
{
if (m_webView->client()) {
// FIXME: Pass a reference to the CSSStyleDeclaration somehow.
- return m_webView->client()->shouldApplyStyle(WebString(),
- WebRange(range));
+ return m_webView->client()->shouldApplyStyle(WebString(), WebRange(range));
}
return true;
}
virtual bool shouldDeleteRange(WebCore::Range*);
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange,
WebCore::EAffinity, bool stillSelecting);
- virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
+ virtual bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*);
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*);
virtual void didBeginEditing();
virtual void respondToChangedContents();
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/EditorClientEfl.cpp:
+ (WebCore::EditorClientEfl::shouldApplyStyle):
+ * WebCoreSupport/EditorClientEfl.h:
+ (EditorClientEfl):
+
2012-02-20 Kihong Kwon <kihong.kwon@samsung.com>
Add a new API for the Vibration API(W3C).
return true;
}
-bool EditorClientEfl::shouldApplyStyle(CSSStyleDeclaration*, Range*)
+bool EditorClientEfl::shouldApplyStyle(StylePropertySet*, Range*)
{
notImplemented();
return true;
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
- virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+ virtual bool shouldApplyStyle(StylePropertySet*, Range*);
virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::EditorClient::shouldApplyStyle):
+ * WebCoreSupport/EditorClientGtk.h:
+ (EditorClient):
+
2012-02-22 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed, rolling out r107351.
return accept;
}
-bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration* declaration, WebCore::Range* range)
+bool EditorClient::shouldApplyStyle(WebCore::StylePropertySet* set, WebCore::Range* range)
{
gboolean accept = TRUE;
- GRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration));
+ GRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(set->ensureCSSStyleDeclaration()));
GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-apply-style", kitDeclaration.get(), kitRange.get(), &accept);
return accept;
virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction);
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting);
- virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
+ virtual bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*);
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*);
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/WebEditorClient.h:
+ (WebEditorClient):
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::shouldApplyStyle):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _setTypingStyle:withUndoAction:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
+ (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
+ * WebView/WebView.mm:
+ (-[WebView applyStyle:]):
+
2012-02-22 Jon Lee <jonlee@apple.com>
Part of r108409 was incorrect, and incorporated an older version of a sub-patch.
virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction) OVERRIDE;
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) OVERRIDE;
- virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) OVERRIDE;
+ virtual bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*) OVERRIDE;
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range* rangeToBeReplaced) OVERRIDE;
return [m_webView isSelectTrailingWhitespaceEnabled];
}
-bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range)
+bool WebEditorClient::shouldApplyStyle(StylePropertySet* style, Range* range)
{
return [[m_webView _editingDelegateForwarder] webView:m_webView
- shouldApplyStyle:kit(style) toElementsInDOMRange:kit(range)];
+ shouldApplyStyle:kit(style->ensureCSSStyleDeclaration()) toElementsInDOMRange:kit(range)];
}
bool WebEditorClient::shouldMoveRangeAfterDelete(Range* range, Range* rangeToBeReplaced)
{
if (!_private->coreFrame)
return;
- _private->coreFrame->editor()->computeAndSetTypingStyle(core(style), undoAction);
+ // FIXME: We shouldn't have to create a copy here.
+ _private->coreFrame->editor()->computeAndSetTypingStyle(core(style)->copy().get(), undoAction);
}
- (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation
- (void)_applyStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
{
- if (Frame* coreFrame = core([self _frame]))
- coreFrame->editor()->applyStyleToSelection(core(style), undoAction);
-}
-
-- (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
-{
- if (Frame* coreFrame = core([self _frame]))
- coreFrame->editor()->applyParagraphStyleToSelection(core(style), undoAction);
+ if (Frame* coreFrame = core([self _frame])) {
+ // FIXME: We shouldn't have to make a copy here. We want callers of this function to work directly with StylePropertySet eventually.
+ coreFrame->editor()->applyStyleToSelection(core(style)->copy().get(), undoAction);
+ }
}
- (BOOL)_handleStyleKeyEquivalent:(NSEvent *)event
{
DOMCSSStyleDeclaration *style = [self _styleFromColorPanelWithSelector:selector];
WebView *webView = [self _webView];
- if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:range])
- if (Frame* coreFrame = core([self _frame]))
- coreFrame->editor()->applyStyle(core(style), [self _undoActionFromColorPanelWithSelector:selector]);
+ if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:range]) {
+ if (Frame* coreFrame = core([self _frame])) {
+ // FIXME: We shouldn't have to make a copy here.
+ coreFrame->editor()->applyStyle(core(style)->copy().get(), [self _undoActionFromColorPanelWithSelector:selector]);
+ }
+ }
+
}
- (void)changeDocumentBackgroundColor:(id)sender
// change the API to allow this.
WebFrame *webFrame = [self _selectedOrMainFrame];
Frame* coreFrame = core(webFrame);
+ // FIXME: We shouldn't have to make a copy here.
if (coreFrame)
- coreFrame->editor()->applyStyle(core(style));
+ coreFrame->editor()->applyStyle(core(style)->copy().get());
}
@end
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldApplyStyle):
+ * WebCoreSupport/EditorClientQt.h:
+ (EditorClientQt):
+
2012-02-21 Csaba Osztrogonác <ossy@webkit.org>
[Qt] tst_QWebPage::infiniteLoopJS() timeouts with DFG JIT
#include "config.h"
#include "EditorClientQt.h"
-#include "CSSStyleDeclaration.h"
#include "Document.h"
#include "UndoStepQt.h"
#include "Editor.h"
#include "Range.h"
#include "Settings.h"
#include "SpatialNavigation.h"
+#include "StylePropertySet.h"
#include "WindowsKeyboardCodes.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
return acceptsEditing;
}
-bool EditorClientQt::shouldApplyStyle(WebCore::CSSStyleDeclaration* style,
+bool EditorClientQt::shouldApplyStyle(WebCore::StylePropertySet* style,
WebCore::Range* range)
{
if (dumpEditingCallbacks)
printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
- QString(style->cssText()).toUtf8().constData(), dumpRange(range).toUtf8().constData());
+ QString(style->asText()).toUtf8().constData(), dumpRange(range).toUtf8().constData());
return acceptsEditing;
}
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
- virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+ virtual bool shouldApplyStyle(StylePropertySet*, Range*);
virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/WebEditorClient.cpp:
+ (WebEditorClient::shouldApplyStyle):
+ * WebCoreSupport/WebEditorClient.h:
+ (WebEditorClient):
+
2012-02-17 Kalev Lember <kalevlember@gmail.com>
Remove unused parameters from WTF threading API
//bool WebEditorClient::shouldChangeSelectedRange(Range *currentRange, Range *toProposedRange, SelectionAffinity selectionAffinity, bool stillSelecting)
//{ notImplemented(); return false; }
-bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* /*style*/, Range* /*toElementsInDOMRange*/)
+bool WebEditorClient::shouldApplyStyle(StylePropertySet* /*style*/, Range* /*toElementsInDOMRange*/)
{ notImplemented(); return true; }
bool WebEditorClient::shouldMoveRangeAfterDelete(Range* /*range*/, Range* /*rangeToBeReplaced*/)
{ notImplemented(); return true; }
-bool WebEditorClient::shouldChangeTypingStyle(CSSStyleDeclaration* /*currentStyle*/, CSSStyleDeclaration* /*toProposedStyle*/)
+bool WebEditorClient::shouldChangeTypingStyle(StylePropertySet* /*currentStyle*/, StylePropertySet* /*toProposedStyle*/)
{ notImplemented(); return false; }
void WebEditorClient::webViewDidChangeTypingStyle(WebNotification* /*notification*/)
bool shouldDeleteRange(WebCore::Range*);
bool shouldInsertNode(WebCore::Node*, WebCore::Range* replacingRange, WebCore::EditorInsertAction);
- bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
+ bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*);
bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*);
- bool shouldChangeTypingStyle(WebCore::CSSStyleDeclaration* currentStyle, WebCore::CSSStyleDeclaration* toProposedStyle);
+ bool shouldChangeTypingStyle(WebCore::StylePropertySet* currentStyle, WebCore::StylePropertySet* toProposedStyle);
void webViewDidChangeTypingStyle(WebNotification*);
void webViewDidChangeSelection(WebNotification*);
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/EditorClientWinCE.cpp:
+ (WebKit::EditorClientWinCE::shouldApplyStyle):
+
2012-02-20 Benjamin Poulain <benjamin@webkit.org>
Get rid of the LocalizationStrategy
return true;
}
-bool EditorClientWinCE::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*)
+bool EditorClientWinCE::shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*)
{
notImplemented();
return true;
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::shouldApplyStyle):
+ * WebKitSupport/EditorClientWx.h:
+ (EditorClientWx):
+
2012-02-15 Sadrul Habib Chowdhury <sadrul@chromium.org>
Notify ChromeClient when touch-event handlers are installed/removed.
return true;
}
-bool EditorClientWx::shouldApplyStyle(CSSStyleDeclaration*,
+bool EditorClientWx::shouldApplyStyle(StylePropertySet*,
Range*)
{
notImplemented();
EditorInsertAction);
virtual bool shouldInsertText(const String&, Range*,
EditorInsertAction);
- virtual bool shouldApplyStyle(CSSStyleDeclaration*,
+ virtual bool shouldApplyStyle(StylePropertySet*,
Range*);
virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange,
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::shouldApplyStyle):
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+ (WebEditorClient):
+
2012-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Null ResourceErrors are encoded/decoded as empty ResourceErrors
return result;
}
-bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range)
+bool WebEditorClient::shouldApplyStyle(StylePropertySet* style, Range* range)
{
- bool result = m_page->injectedBundleEditorClient().shouldApplyStyle(m_page, style, range);
+ bool result = m_page->injectedBundleEditorClient().shouldApplyStyle(m_page, style->ensureCSSStyleDeclaration(), range);
notImplemented();
return result;
}
virtual bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) OVERRIDE;
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) OVERRIDE;
- virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) OVERRIDE;
+ virtual bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*) OVERRIDE;
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) OVERRIDE;
virtual void didBeginEditing() OVERRIDE;