[Webkit-unassigned] [Bug 41989] New: stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jul 9 14:30:34 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=41989
Summary: stateStyle (@EditorCommand.cpp) should ask
EditingBehavior for platform specific behavior
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: HTML DOM
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: tonikitoo at webkit.org
CC: darin at apple.com, ojan at chromium.org
Depends on: 39854
Spin off of the discussion in bug 39854, specially in https://bugs.webkit.org/show_bug.cgi?id=39854#c44 and https://bugs.webkit.org/show_bug.cgi?id=39854#c52
This won't be a refactor only (tests needed), and needs to work for the following situations (detailed by Ojan):
------------------------
When shouldConsiderStylePresentOnlyIfThroughoutTheSelection is true it's taking what used to be a tri-state and making it a boolean. Specifically, I think we'd return the wrong value in the following case:
<div id=foo contentEditable>foo<b>bar</b></div>
<script>
window.getSelection().selectAllChildren(foo);
console.log(document.queryCommandIndeterm('bold'));
</script>
That should log "true" to the console. With your patch, I think it would log "false". On the other hand, this patch fixes queryCommandState to return the correct value in this case. Currently it would return true for the above and should return false.
It would be unfortunate to fix one case and break the other. Can we do this as two separate patches?
1. Just change the current editingBehavior call. Call the method shouldToggleStyleBasedOnStartOfSelection, but also put a FIXME to use that method in stateStyle for the cases where it's used for queryCommandState.
2. Rename shouldToggleStyleBasedOnStartOfSelection to shouldConsiderStylePresentOnlyIfThroughoutTheSelection and use it in stateStyle, but not if it's being used to get a return value for queryCommandIndeterm. This is a bit complicated because right now both queryCommandState and queryCommandIndeterm end up calling the same method. So it would require a few more changes to EditorCommand.cpp.
-------------------------------
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list