WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
9575
replaceSelectionWithMarkupString merges blockquotes
https://bugs.webkit.org/show_bug.cgi?id=9575
Summary
replaceSelectionWithMarkupString merges blockquotes
Graham Dennis
Reported
2006-06-25 06:24:31 PDT
I'm not sure if this is in fact a bug but... If you call [webView replaceSelectionWithMarkupString:] with a string like: <blockquote>Text</blockquote> One would expect a blockquote tag to be inserted (unless you happen to be Mail.app...). However the blockquote tag isn't inserted because shouldMergeStart() returns true (the last condition returns true). I'm happy to fix this if it is in fact a bug.... so is it?
Attachments
Add attachment
proposed patch, testcase, etc.
Justin Garcia
Comment 1
2006-06-26 17:13:07 PDT
The fact that we force the first bit of content being inserted onto the same line as the content before the selection being pasted into is not a bug. To get that behavior we must strip blocks surrounding the first paragraph of the incoming fragment. We could strip blocks surrounding the content before the selection being pasted into but that could produce bad visual results: you'd paste something into a bordered block and the border would go away. It would be nice if there was a way to override this behavior though. To work around this, you could put an interchange newline at the beginning of the markup when the selection being pasted into doesn't start at the start of a paragraph <br class="Apple-interchange-newline"> <blockquote>Text</blockquote> ... You'll also want an interchange newline at the end of the fragment if the selection being pasted into doesn't end at the end of a paragraph.
Graham Dennis
Comment 2
2006-06-27 00:07:47 PDT
Your suggestion with interchange <br>'s gives me: <div> Text before caret </div> <blockquote> Quote </blockquote> <div> Text after caret </div> Whereas ideally I would like: <div> Text before caret <blockquote> Quote </blockquote> Text after caret </div> In most cases they should be visually identical, but is there a way to do this without creating a document fragment and directly inserting that?
Ahmad Saleem
Comment 3
2022-09-10 07:45:05 PDT
We still have references to replaceSelectionWithMarkupString in: Source/WebKitLegacy/win/WebView.h Source/WebKitLegacy/win/WebView.cpp Only references are in WebkitLegacy or WK1, is it something we are planning to fix or valid these days or we can mark this as "RESOLVED WONTFIX" etc., appreciate if someone else can comment here. Thanks!
Ryosuke Niwa
Comment 4
2022-09-10 14:05:42 PDT
We're no longer making improvements to WebKitLegacy API at this point.
Alexey Proskuryakov
Comment 5
2022-09-10 14:48:57 PDT
What Ryosuke said. However, not sure if your search was exhaustive, we have it outside Windows directories too (still WK1 only). $ grep -r replaceSelectionWithMarkupString Source/ Source//WebKitLegacy/win/WebView.h: HRESULT STDMETHODCALLTYPE replaceSelectionWithMarkupString(_In_ BSTR) override; Source//WebKitLegacy/win/WebView.cpp:HRESULT WebView::replaceSelectionWithMarkupString(_In_ BSTR /*markupString*/) Source//WebKitLegacy/win/Interfaces/IWebView.idl: - (void)replaceSelectionWithMarkupString:(NSString *)markupString; Source//WebKitLegacy/win/Interfaces/IWebView.idl: HRESULT replaceSelectionWithMarkupString([in] BSTR markupString); Source//WebKitLegacy/mac/WebView/WebView.mm:- (void)replaceSelectionWithMarkupString:(NSString *)markupString Source//WebKitLegacy/mac/WebView/WebView.mm: [[self _selectedOrMainFrame] _replaceSelectionWithMarkupString:markupString baseURLString:nil selectReplacement:YES smartReplace:NO]; Source//WebKitLegacy/mac/WebView/WebView.h:- (void)replaceSelectionWithMarkupString:(NSString *)markupString; Source//WebKitLegacy/mac/WebView/WebFramePrivate.h:- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace; Source//WebKitLegacy/mac/WebView/WebFrame.mm:- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug