<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>8811</bug_id>
          
          <creation_ts>2006-05-09 14:00:19 -0700</creation_ts>
          <short_desc>REGRESSION: TinyMCE: Style toolbar buttons don&apos;t work</short_desc>
          <delta_ts>2006-06-05 08:28:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>7508</dup_id>
          
          <bug_file_loc>http://tinymce.moxiecode.com/example.php?example=true</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>6627</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Justin Garcia">justin.garcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41634</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2006-05-09 14:00:19 -0700</bug_when>
    <thetext>When you click on Bold, Italic, Underline or Strikethrough, the current typing style doesn&apos;t change.  This used to work.  But, we went back into the nightly build history and couldn&apos;t find a build where it worked.  This probably means that the regression is in TinyMCE sources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44711</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-06-04 16:40:21 -0700</bug_when>
    <thetext>The immediate cause for the fact that the bold button doesn&apos;t work is that the page calls window.selection.setBaseAndExtent to change the selection, and all 4 parameters are &quot;undefined&quot;. This results in clearing the selection.

I don&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44720</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-06-04 17:01:25 -0700</bug_when>
    <thetext>Yes, the code that&apos;s going awry is some Safari-specific code that&apos;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&apos;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&apos;t have properties with those names.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44770</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-06-05 08:28:42 -0700</bug_when>
    <thetext>Given my analysis, this is a duplicate of bug 7508.

*** This bug has been marked as a duplicate of 7508 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>