WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
203610
[GTK] 'RemoveFormat' editing command changes style of the parent block element
https://bugs.webkit.org/show_bug.cgi?id=203610
Summary
[GTK] 'RemoveFormat' editing command changes style of the parent block element
Milan Crha
Reported
2019-10-30 07:25:03 PDT
I do not expect the 'RemoveFormat' editing command to also influence 'style' attribute of the parent's block (div/p/...) of the active selection, but maybe I'm wrong. Steps to reproduce: a) open the Web Inspector of a WebKitWebView and switch to the console; b) execute these two commands: document.documentElement.innerHTML = "<body><div style='text-align:right'>aaa <b>bbb <i>iii <u>uuu</u></i></b> xxx</div></body>" document.getSelection().setBaseAndExtent(document.body.firstElementChild.firstElementChild.firstChild, 1, document.body.firstElementChild.firstElementChild.firstElementChild.firstChild, 2) c) it created a document with right-aligned div and selected 'bb ii' in it d) remove the format on the selection, by executing this command: document.execCommand("RemoveFormat") The outcome is that the selected text is neither bold nor italic, as expected, but the text is aligned to the left now, while it should stay aligned to the right. It can be that it's only an overlook on the text-align style (and maybe some other), because when the div has style: "text-align:right; color:orange;", then the color is preserved, only the text-align is reset after the RemoveFormat command.
Attachments
Add attachment
proposed patch, testcase, etc.
Milan Crha
Comment 1
2019-10-30 07:25:50 PDT
Bug #194156
can be related, but maybe not. I do not know.
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