[webkit-dev] Getting text alignment in editing mode?
darin at apple.com
Fri Jan 23 08:47:48 PST 2009
On Jan 22, 2009, at 10:29 AM, Kevin Ollivier wrote:
> I'm working on adding HTML editing capabilities to the wxWebKit API,
> and I've gotten a lot of things working by exposing the edit
> commands, as well as providing a level of DOM wrapping for getting/
> manipulating attributes. One thing I've been unable to figure out,
> though, is how to get the text alignment(s) of a selection. The
> Align(Left/Center/Right/Justify) commands do not provide a mechanism
> for reporting the state of those commands, and neither do I see an
> API in Editor, SelectionController, or DOMRange for it. Is there an
> 'official' way to get this information, or is it a matter of
> traversing the DOM and getting the info from each element myself?
It's a missing feature. I think that Align commands should probably
implement state, although they currently don't. The stateStyle
functions might have close to the right logic, but they might also
need added changes that understand that these are block styles rather
than styles that can affect arbitrary runs of text.
More information about the webkit-dev