Changeset 14498 in webkit


Ignore:
Timestamp:
May 19, 2006 5:21:46 PM (18 years ago)
Author:
lweintraub
Message:

LayoutTests:

Reviewed by justin.


Tests for <http://bugzilla.opendarwin.org/show_bug.cgi?id=8931>
Drag caret not painted for editable sub-frames

  • editing/resources/select-and-drag-iframe.html: Added.
  • editing/selection/drag-in-iframe-expected.checksum: Added.
  • editing/selection/drag-in-iframe-expected.png: Added.
  • editing/selection/drag-in-iframe-expected.txt: Added.
  • editing/selection/drag-in-iframe.html: Added.

WebCore:

Reviewed by justin.


<http://bugzilla.opendarwin.org/show_bug.cgi?id=8931>
Drag caret not painted for editable sub-frames


Moved the drag caret out of Frame and into Page.
Only the Frame that contains the drag caret will paint it.

  • editing/SelectionController.h:
  • page/Frame.cpp: (WebCore::Frame::dragCaret): (WebCore::Frame::setDragCaret): (WebCore::Frame::paintDragCaret):
  • page/FramePrivate.h:
  • page/Page.cpp: (WebCore::Page::dragCaret): (WebCore::Page::setDragCaret):
  • page/Page.h:
Location:
trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r14495 r14498  
     12006-05-19  Levi Weintraub  <lweintraub@apple.com>
     2
     3        Reviewed by justin.
     4       
     5        Tests for <http://bugzilla.opendarwin.org/show_bug.cgi?id=8931>
     6        Drag caret not painted for editable sub-frames
     7
     8        * editing/resources/select-and-drag-iframe.html: Added.
     9        * editing/selection/drag-in-iframe-expected.checksum: Added.
     10        * editing/selection/drag-in-iframe-expected.png: Added.
     11        * editing/selection/drag-in-iframe-expected.txt: Added.
     12        * editing/selection/drag-in-iframe.html: Added.
     13
    1142006-05-17  Geoffrey Garen  <ggaren@apple.com>
    215
  • trunk/WebCore/ChangeLog

    r14497 r14498  
     12006-05-19  Levi Weintraub  <lweintraub@apple.com>
     2
     3        Reviewed by justin.
     4       
     5        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8931>
     6        Drag caret not painted for editable sub-frames
     7       
     8        Moved the drag caret out of Frame and into Page.
     9        Only the Frame that contains the drag caret will paint it.
     10
     11        * editing/SelectionController.h:
     12        * page/Frame.cpp:
     13        (WebCore::Frame::dragCaret):
     14        (WebCore::Frame::setDragCaret):
     15        (WebCore::Frame::paintDragCaret):
     16        * page/FramePrivate.h:
     17        * page/Page.cpp:
     18        (WebCore::Page::dragCaret):
     19        (WebCore::Page::setDragCaret):
     20        * page/Page.h:
     21
    1222006-05-19  Alice Liu  <alice.liu@apple.com>
    223
  • trunk/WebCore/editing/SelectionController.h

    r13889 r14498  
    105105
    106106    void debugRenderer(RenderObject*, bool selected) const;
    107 
    108     friend class Frame;
    109107   
    110108    Frame* frame() const;
     
    150148    //void clear();
    151149    //TextRange *createRange();
     150   
     151    void needsCaretRepaint();
     152    void paintCaret(GraphicsContext*, const IntRect &rect);
    152153
    153154#ifndef NDEBUG
     
    165166
    166167    void layout();
    167     void needsCaretRepaint();
    168     void paintCaret(GraphicsContext*, const IntRect &rect);
    169168    IntRect caretRepaintRect() const;
    170169
  • trunk/WebCore/page/Frame.cpp

    r14455 r14498  
    5454#include "MouseEventWithHitTestResults.h"
    5555#include "NodeList.h"
     56#include "Page.h"
    5657#include "Plugin.h"
    5758#include "RenderCanvas.h"
     
    11261127SelectionController& Frame::dragCaret() const
    11271128{
    1128     return d->m_dragCaret;
     1129    return d->m_page->dragCaret();
    11291130}
    11301131
     
    11701171void Frame::setDragCaret(const SelectionController& dragCaret)
    11711172{
    1172     if (d->m_dragCaret != dragCaret) {
    1173         d->m_dragCaret.needsCaretRepaint();
    1174         d->m_dragCaret = dragCaret;
    1175         d->m_dragCaret.needsCaretRepaint();
    1176     }
     1173    d->m_page->setDragCaret(dragCaret);
    11771174}
    11781175
     
    13001297void Frame::paintDragCaret(GraphicsContext* p, const IntRect& rect) const
    13011298{
    1302     d->m_dragCaret.paintCaret(p, rect);
     1299    SelectionController& dragCaret = d->m_page->dragCaret();
     1300    assert(dragCaret.selection().isCaret());
     1301    if (dragCaret.selection().start().node()->document()->frame() == this)
     1302        dragCaret.paintCaret(p, rect);
    13031303}
    13041304
  • trunk/WebCore/page/FramePrivate.h

    r14447 r14498  
    183183
    184184        SelectionController m_selection;
    185         SelectionController m_dragCaret;
    186185        Selection m_mark;
    187186        Timer<Frame> m_caretBlinkTimer;
  • trunk/WebCore/page/Page.cpp

    r14256 r14498  
    123123}
    124124
     125SelectionController& Page::dragCaret() const
     126{
     127    return m_dragCaret;
    125128}
     129
     130void Page::setDragCaret(const SelectionController& dragCaret)
     131{
     132    if (m_dragCaret != dragCaret) {
     133        m_dragCaret.needsCaretRepaint();
     134        m_dragCaret = dragCaret;
     135        m_dragCaret.needsCaretRepaint();
     136    }
     137}
     138
     139}
  • trunk/WebCore/page/Page.h

    r14256 r14498  
    2323
    2424#include "PlatformString.h"
     25#include "SelectionController.h"
    2526#include <wtf/HashSet.h>
    2627
     
    6263        static void setNeedsReapplyStyles();
    6364        static void setNeedsReapplyStylesForSettingsChange(KHTMLSettings*);
     65       
     66        // FIXME: Replace this with a function on the selection controller or change it to Selection instead?
     67        void setDragCaret(const SelectionController&);
     68        SelectionController& dragCaret() const; // FIXME: Change to pointer?
    6469
    6570#if __APPLE__
     
    7883        int m_frameCount;
    7984        String m_groupName;
     85        mutable SelectionController m_dragCaret;
    8086
    8187#if __APPLE__
Note: See TracChangeset for help on using the changeset viewer.