Bug 11178 - document.execCommand with designMode on bugs
Summary: document.execCommand with designMode on bugs
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 419.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://loverevolution21.com/safari/
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-05 14:56 PDT by David Rehfeldt
Modified: 2011-03-17 18:21 PDT (History)
1 user (show)

See Also:


Attachments
test case (23.44 KB, application/zip)
2007-07-05 05:05 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Rehfeldt 2006-10-05 14:56:06 PDT
See the URL listed for a live example of this.

If you have an iFrame that has designMode set to "on" and you call:

foo.contentWindow.document.execCommand('fontsize', false, 5) // or any value

The function will return true, but will not actually update the text selected/additional text added. Fontsize in general seems to do nothing at all, but still returns true every time execCommand is called.

Not sure if this is also a bug, but:
 if a color is specified in the third parameter of execCommand for say 'backcolor' or 'forecolor', and the color has leading zeroes without a pound sign (ie: 00FFFF), execCommand will again return true but not change the font color. Using the #00FFFF notation will work correctly, but other browsers (firefox and IE) support either. It doesn't seem to make sense to return True if nothing was changed.
Comment 1 Alexey Proskuryakov 2007-07-05 05:04:03 PDT
With r23922, fontsize already works, but forecolor without '#' still doesn't.
Comment 2 Alexey Proskuryakov 2007-07-05 05:05:19 PDT
Created attachment 15400 [details]
test case

The bug URL has a test case, but it references non-existing copies of YUI libraries. This archive contains a complete test case.
Comment 3 Justin Garcia 2011-03-17 18:21:43 PDT
Works for me.