Changeset 30515 in webkit


Ignore:
Timestamp:
Feb 22, 2008 9:14:55 PM (16 years ago)
Author:
justin.garcia@apple.com
Message:

WebCore:

Reviewed by Anders Carlsson.

<rdar://problem/5714333> Add document.getSelection()


Add a synonym for window.getSelection() that FF supports. There were requests in
this bugs dupes to also support the IE only document.selection, but IE's Selection
object is too different than ours currently for that to be safe (specifically, we
don't support enough of IE's TextRange methods on our DOM Range object yet). I
filed <rdar://problem/5761233> to cover that.

  • dom/Document.cpp: (WebCore::Document::getSelection): Added.
  • dom/Document.h:
  • dom/Document.idl: Ditto. JS only since this is about web compatibility.

LayoutTests:

Reviewed by Anders.


<rdar://problem/5714333> Add document.getSelection()

  • editing/selection/5714333-expected.txt: Added.
  • editing/selection/5714333.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r30506 r30515  
     12008-02-22  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Anders.
     4       
     5        <rdar://problem/5714333> Add document.getSelection()
     6
     7        * editing/selection/5714333-expected.txt: Added.
     8        * editing/selection/5714333.html: Added.
     9
    1102008-02-22  Oliver Hunt  <oliver@apple.com>
    211
  • trunk/WebCore/ChangeLog

    r30514 r30515  
     12008-02-22  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        <rdar://problem/5714333> Add document.getSelection()
     6       
     7        Add a synonym for window.getSelection() that FF supports.  There were requests in
     8        this bugs dupes to also support the IE only document.selection, but IE's Selection
     9        object is too different than ours currently for that to be safe (specifically, we
     10        don't support enough of IE's TextRange methods on our DOM Range object yet). I
     11        filed <rdar://problem/5761233> to cover that.
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::getSelection): Added.
     15        * dom/Document.h:
     16        * dom/Document.idl: Ditto.  JS only since this is about web compatibility.
     17
    1182008-02-22  Oliver Hunt  <oliver@apple.com>
    219
  • trunk/WebCore/dom/Document.cpp

    r30450 r30515  
    4242#include "DocumentLoader.h"
    4343#include "DocumentType.h"
     44#include "DOMWindow.h"
    4445#include "EditingText.h"
    4546#include "Editor.h"
     
    37683769}
    37693770
     3771// FF method for accessing the selection added for compatability.
     3772DOMSelection* Document::getSelection() const
     3773{
     3774    return frame() ? frame()->domWindow()->getSelection() : 0;
     3775}
     3776
    37703777#if ENABLE(DATABASE)
    37713778
  • trunk/WebCore/dom/Document.h

    r30431 r30515  
    6161    class Database;
    6262    class DOMImplementation;
     63    class DOMSelection;
    6364    class DOMWindow;
    6465    class DatabaseThread;
     
    691692    void cancelFocusAppearanceUpdate();
    692693   
     694    // FF method for accessing the selection added for compatability.
     695    DOMSelection* getSelection() const;
     696   
    693697private:
    694698    CSSStyleSelector* m_styleSelector;
  • trunk/WebCore/dom/Document.idl

    r30052 r30515  
    194194
    195195        // Mozilla extensions
    196 
     196#if defined(LANGUAGE_JAVASCRIPT)
     197        DOMSelection       getSelection();
     198#endif
    197199        readonly attribute [ConvertNullStringTo=Null] DOMString characterSet;
    198200
Note: See TracChangeset for help on using the changeset viewer.