Changeset 123214 in webkit


Ignore:
Timestamp:
Jul 20, 2012 7:23:37 AM (12 years ago)
Author:
pierre.rossi@gmail.com
Message:

ColorChooserClient should expose the element's location
https://bugs.webkit.org/show_bug.cgi?id=91767

Reviewed by Kent Tamura.

The rationale is that the chrome client could have an interest in placing the picker next to
the element for usability reasons.

No new tests as there is not much logic here: Just exposing a geometry information to WebKit.

  • html/ColorInputType.cpp:

(WebCore::ColorInputType::elementRectRelativeToWindow):
(WebCore):

  • html/ColorInputType.h:

(ColorInputType):

  • platform/ColorChooserClient.h:

(ColorChooserClient):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r123212 r123214  
     12012-07-20  Pierre Rossi  <pierre.rossi@gmail.com>
     2
     3        ColorChooserClient should expose the element's location
     4        https://bugs.webkit.org/show_bug.cgi?id=91767
     5
     6        Reviewed by Kent Tamura.
     7
     8        The rationale is that the chrome client could have an interest in placing the picker next to
     9        the element for usability reasons.
     10
     11        No new tests as there is not much logic here: Just exposing a geometry information to WebKit.
     12
     13        * html/ColorInputType.cpp:
     14        (WebCore::ColorInputType::elementRectRelativeToWindow):
     15        (WebCore):
     16        * html/ColorInputType.h:
     17        (ColorInputType):
     18        * platform/ColorChooserClient.h:
     19        (ColorChooserClient):
     20
    1212012-07-20  Thiago Marcos P. Santos  <thiago.santos@intel.com>
    222
  • trunk/Source/WebCore/html/ColorInputType.cpp

    r123082 r123214  
    3939#include "HTMLInputElement.h"
    4040#include "MouseEvent.h"
     41#include "RenderObject.h"
     42#include "RenderView.h"
    4143#include "ScriptController.h"
    4244#include "ShadowRoot.h"
     
    196198}
    197199
     200IntRect ColorInputType::elementRectRelativeToWindow() const
     201{
     202    RenderObject* renderer = element()->renderer();
     203    ASSERT(renderer);
     204    return pixelSnappedIntRect(renderer->view()->frameView()->contentsToWindow(renderer->absoluteBoundingBoxRect()));
     205}
     206
    198207} // namespace WebCore
    199208
  • trunk/Source/WebCore/html/ColorInputType.h

    r115704 r123214  
    4747    virtual void didChooseColor(const Color&) OVERRIDE;
    4848    virtual void didEndChooser() OVERRIDE;
     49    virtual IntRect elementRectRelativeToWindow() const OVERRIDE;
    4950
    5051private:
  • trunk/Source/WebCore/platform/ColorChooserClient.h

    r112658 r123214  
    55
    66#include "ColorChooser.h"
     7#include "IntRect.h"
    78#include <wtf/OwnPtr.h>
    89#include <wtf/PassOwnPtr.h>
     
    1819    virtual void didChooseColor(const Color&) = 0;
    1920    virtual void didEndChooser() = 0;
     21    virtual IntRect elementRectRelativeToWindow() const = 0;
    2022};
    2123
Note: See TracChangeset for help on using the changeset viewer.