WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
93678
Make an event object clonable to support an event propagation across seamless iframes.
https://bugs.webkit.org/show_bug.cgi?id=93678
Summary
Make an event object clonable to support an event propagation across seamless...
Hayato Ito
Reported
2012-08-09 19:11:54 PDT
To support a event propagation of seamless iframes, we have to create new Event object based on the original Event object for each browsing context so that we can isolate each event object.
Attachments
make it clonable
(5.18 KB, patch)
2012-08-14 07:01 PDT
,
Hayato Ito
no flags
Details
Formatted Diff
Diff
sync
(5.24 KB, patch)
2012-08-15 18:36 PDT
,
Hayato Ito
no flags
Details
Formatted Diff
Diff
Patch for landing
(5.29 KB, patch)
2012-08-21 18:42 PDT
,
Hayato Ito
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Hayato Ito
Comment 1
2012-08-14 07:01:03 PDT
Created
attachment 158318
[details]
make it clonable
Hayato Ito
Comment 2
2012-08-15 18:36:19 PDT
Created
attachment 158683
[details]
sync
Dimitri Glazkov (Google)
Comment 3
2012-08-21 12:57:40 PDT
Comment on
attachment 158683
[details]
sync View in context:
https://bugs.webkit.org/attachment.cgi?id=158683&action=review
> Source/WebCore/dom/MouseEvent.cpp:161 > +PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
Can we just pass Frame* here? Not sure the fact that it's coming from HTMLIFrameElement is important here.
Ojan Vafai
Comment 4
2012-08-21 14:04:35 PDT
Comment on
attachment 158683
[details]
sync View in context:
https://bugs.webkit.org/attachment.cgi?id=158683&action=review
I'm fine with just putting FIXMEs for now for the positioning comments and fixing this when you actually do the retargeting patch since you can actually test it that way. Up to you, either way is fine.
> Source/WebCore/dom/MouseEvent.cpp:151 > +inline static int adjustedClinetX(int innerClientX, HTMLIFrameElement* iframe, FrameView* frameView)
Typo here and below s/Clinet/Client.
> Source/WebCore/dom/MouseEvent.cpp:153 > + return iframe->offsetLeft() - frameView->scrollX() + innerClientX;
This gives you the border x position. I think you need to subtract the borderLeft and paddingLeft here. Also, the offset* methods give you a number relative to your offsetParent. I believe client* on the Event give you viewport relative locations. So, here's a testcase that covers all these things: <div style="position:relative"> <iframe seamless style="position:absolute; border: 10px solid; padding: 5px"></iframe> </div> offsetLeft/offsetTop on the iframe will be 0. Instead off offsetLeft/Top you should just use x() and y() on the iframe. I'm not sure off the top of my head whether x()/y() are the border positions or the content positions. I think it's the border position, so you'll still need to remove the border/padding.
> Source/WebCore/dom/MouseEvent.cpp:158 > +inline static int adjustedClinetY(int innerClientY, HTMLIFrameElement* iframe, FrameView* frameView) > +{ > + return iframe->offsetTop() - frameView->scrollY() + innerClientY;
ditto
Hayato Ito
Comment 5
2012-08-21 17:43:46 PDT
Thank you for the reviews. (In reply to
comment #3
)
> (From update of
attachment 158683
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=158683&action=review
> > > Source/WebCore/dom/MouseEvent.cpp:161 > > +PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const > > Can we just pass Frame* here? Not sure the fact that it's coming from HTMLIFrameElement is important here.
We need a HTMLIFrameElement to adjust a (x, y) coordinate for MouseEvent. (In reply to
comment #4
)
> (From update of
attachment 158683
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=158683&action=review
> > I'm fine with just putting FIXMEs for now for the positioning comments and fixing this when you actually do the retargeting patch since you can actually test it that way. Up to you, either way is fine.
Thank you. I'd like to putting FIXME for now. It's not easy task for me to calculate new x and y exactly. Let me fix it when I can test it using actual LayoutTest in a later patch.
> > > Source/WebCore/dom/MouseEvent.cpp:151 > > +inline static int adjustedClinetX(int innerClientX, HTMLIFrameElement* iframe, FrameView* frameView) > > Typo here and below s/Clinet/Client.
Ops. I'll fix it.
> > > Source/WebCore/dom/MouseEvent.cpp:153 > > + return iframe->offsetLeft() - frameView->scrollX() + innerClientX; > > This gives you the border x position. I think you need to subtract the borderLeft and paddingLeft here. Also, the offset* methods give you a number relative to your offsetParent. I believe client* on the Event give you viewport relative locations. > > So, here's a testcase that covers all these things: > <div style="position:relative"> > <iframe seamless style="position:absolute; border: 10px solid; padding: 5px"></iframe> > </div> > > offsetLeft/offsetTop on the iframe will be 0. Instead off offsetLeft/Top you should just use x() and y() on the iframe. I'm not sure off the top of my head whether x()/y() are the border positions or the content positions. I think it's the border position, so you'll still need to remove the border/padding.
Thank you. I'll fix it later. I need actual layout tests to make sure that we can adjust it correctly. I might ask further in another bug entry I am going to file in regard to this.
> > > Source/WebCore/dom/MouseEvent.cpp:158 > > +inline static int adjustedClinetY(int innerClientY, HTMLIFrameElement* iframe, FrameView* frameView) > > +{ > > + return iframe->offsetTop() - frameView->scrollY() + innerClientY; > > ditto
Hayato Ito
Comment 6
2012-08-21 18:42:16 PDT
Created
attachment 159838
[details]
Patch for landing
Hayato Ito
Comment 7
2012-08-21 18:46:09 PDT
Let me use this bug to fix positioning.
https://bugs.webkit.org/show_bug.cgi?id=93696
(In reply to
comment #6
)
> Created an attachment (id=159838) [details] > Patch for landing
WebKit Review Bot
Comment 8
2012-08-21 20:11:31 PDT
Comment on
attachment 159838
[details]
Patch for landing Clearing flags on attachment: 159838 Committed
r126256
: <
http://trac.webkit.org/changeset/126256
>
WebKit Review Bot
Comment 9
2012-08-21 20:11:34 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug