Bug 8811
Summary: | REGRESSION: TinyMCE: Style toolbar buttons don't work | ||
---|---|---|---|
Product: | WebKit | Reporter: | Justin Garcia <justin.garcia> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | Keywords: | Regression |
Priority: | P1 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
URL: | http://tinymce.moxiecode.com/example.php?example=true | ||
Bug Depends on: | |||
Bug Blocks: | 6627 |
Justin Garcia
When you click on Bold, Italic, Underline or Strikethrough, the current typing style doesn't change. This used to work. But, we went back into the nightly build history and couldn't find a build where it worked. This probably means that the regression is in TinyMCE sources.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Darin Adler
The immediate cause for the fact that the bold button doesn't work is that the page calls window.selection.setBaseAndExtent to change the selection, and all 4 parameters are "undefined". This results in clearing the selection.
I don't know what previous problem causes it to try to set the selection to undefined, undefined, undefined, undefined. There are two calls to setBaseAndExtent in the TinyMCE JavaScript, and the one that could pass those values looks like the one in moveToBookmark.
Darin Adler
Yes, the code that's going awry is some Safari-specific code that's attempting to work around the fact that the selection gets cleared in older versions of Safari. If you change the user agent string to Firefox, the toolbar buttons work just fine.
There's something called lastSafariSelection.
It looks like this section of the moveToBookmark function is the buggy Safari-specific TinyMCE code:
if (tinyMCE.isSafari) {
sel.setBaseAndExtent(bookmark.startContainer, bookmark.startOffset,
bookmark.endContainer, bookmark.endOffset);
return true;
}
That should be bookmark.rng.startContainer, bookmark.rng.startOffset, etc. A bookmark doesn't have properties with those names.
Darin Adler
Given my analysis, this is a duplicate of bug 7508.
*** This bug has been marked as a duplicate of 7508 ***