<?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>13399</bug_id>
          
          <creation_ts>2007-04-18 17:35:56 -0700</creation_ts>
          <short_desc>Support document.getSelection()</short_desc>
          <delta_ts>2008-02-22 23:19:30 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>EasyFix, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Justin Garcia">justin.garcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>14194</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2007-04-18 17:35:56 -0700</bug_when>
    <thetext>&lt;rdar://problem/3138411&gt; MASTER: document.getSelection() and document.selection

window.getSelection() is the most common way to access the selection object, followed by document.getSelection() followed by document.selection.  All three return a selection object, that supports various methods/properties depending on what browser the user is running.  We support window.getSelection(), but it would probably be a good idea for us to add document.getSelection() and document.selection, for compatibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68762</commentid>
    <comment_count>1</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2008-01-29 20:18:46 -0800</bug_when>
    <thetext>The original radar, &lt;rdar://problem/3138411&gt;, was accidently closed.  Opened:

&lt;rdar://problem/5714333&gt; Add document.getSelection() and document.selection</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71438</commentid>
    <comment_count>2</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2008-02-21 16:34:49 -0800</bug_when>
    <thetext>I don&apos;t think we want to add support for document.selection.  This is an IE specific extention and their selection object is too different than Safari&apos;s or FF&apos;s.  In a few of the dupes of &lt;rdar://problem/3138411&gt; I see code like this:

&lt;a href=&quot;javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(pmentry=window.open(&apos;http://jens.apple.com/pm/index.php?m=bookmarklet&amp;p=new&amp;title=&apos;+escape(document.title)+&apos;&amp;url=&apos;+escape(window.location.href)+&apos;&amp;body=&apos;+escape(bm),&apos;pmentry&apos;,&apos;width=700,height=520,toolbar=0,status=1,location=0,scrollbars=1,menubar=1,resizable=1&apos;))&quot;&gt;pMachineBM&lt;/a&gt;

If we added support for document.selection we&apos;d fall into the IE specific code path, which has us calling more IE specific extentions that neither Safari nor FF supports (selection.createRange() for example returns a TextRange object, not a DOM Range object, which has all sorts of IE specific extentions).  Perhaps at a later time if we extend DOM Range to support more methods we can implement document.selection.

I think that for now, supporting code that works in FF is good enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71561</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-02-22 23:19:30 -0800</bug_when>
    <thetext>Fixed by Justin in &lt;http://trac.webkit.org/projects/webkit/changeset/30515&gt;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>