Currently, EditorCommand is responsible for checking the value returned by shouldToggleStyleBasedOnStartOfSelection and calling either selectionHasStyle or selectionStartHasStyle. However, each port also calls selectionHasStyle in Source/WebKit without calling shouldToggleStyleBasedOnStartOfSelection and causing Mac port to behave inconsistently. We should merge these two functions so that selectionHasStyle calls selectionStartHasStyle as needed.
Mn... this bug might be invalid after all. We do call selectionHasStyle in WebKit but only for text direction. And it seems odd to determine the direction of text merely based at the selection start.