WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
104107
[WK2] Move button image to injected bundle
https://bugs.webkit.org/show_bug.cgi?id=104107
Summary
[WK2] Move button image to injected bundle
Jon Lee
Reported
2012-12-05 03:10:57 PST
Allow the bundle to specify the images to use.
Attachments
Patch
(75.53 KB, patch)
2012-12-05 03:33 PST
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(75.50 KB, patch)
2012-12-05 03:52 PST
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(75.57 KB, patch)
2012-12-05 09:02 PST
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(74.29 KB, patch)
2012-12-07 04:15 PST
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(26.18 KB, patch)
2012-12-07 09:21 PST
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(47.24 KB, patch)
2012-12-07 09:32 PST
,
Jon Lee
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2012-12-05 03:11:25 PST
<
rdar://problem/12813842
>
Jon Lee
Comment 2
2012-12-05 03:33:58 PST
Created
attachment 177713
[details]
Patch
Early Warning System Bot
Comment 3
2012-12-05 03:40:02 PST
Comment on
attachment 177713
[details]
Patch
Attachment 177713
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/15159206
Early Warning System Bot
Comment 4
2012-12-05 03:40:43 PST
Comment on
attachment 177713
[details]
Patch
Attachment 177713
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/15160179
Jon Lee
Comment 5
2012-12-05 03:52:43 PST
Created
attachment 177720
[details]
Patch
Early Warning System Bot
Comment 6
2012-12-05 03:58:11 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/15133796
WebKit Review Bot
Comment 7
2012-12-05 04:07:25 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/15152360
Peter Beverloo (cr-android ews)
Comment 8
2012-12-05 04:07:37 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass cr-android-ews (chromium-android): Output:
http://queues.webkit.org/results/15152358
Build Bot
Comment 9
2012-12-05 04:25:38 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/15148445
EFL EWS Bot
Comment 10
2012-12-05 05:06:24 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/15152374
kov's GTK+ EWS bot
Comment 11
2012-12-05 08:24:58 PST
Comment on
attachment 177720
[details]
Patch
Attachment 177720
[details]
did not pass gtk-ews (gtk): Output:
http://queues.webkit.org/results/15159276
Jon Lee
Comment 12
2012-12-05 09:02:35 PST
Created
attachment 177766
[details]
Patch
Jon Lee
Comment 13
2012-12-07 04:15:09 PST
Created
attachment 178195
[details]
Patch
Jon Lee
Comment 14
2012-12-07 09:21:03 PST
Created
attachment 178226
[details]
Patch
Jon Lee
Comment 15
2012-12-07 09:32:14 PST
Created
attachment 178228
[details]
Patch
Simon Fraser (smfr)
Comment 16
2012-12-07 13:50:26 PST
Comment on
attachment 178228
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=178228&action=review
> Source/WebCore/page/ChromeClient.h:376 > + virtual PassRefPtr<Image> generatePlugInStartButtonImage(RenderSnapshottedPlugIn::ButtonSize) const { return 0; }
Why 'generate'? Why not just plugInStartButtonImage() ?
> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:138 > + if (initializedImages[arrayIndex]) > + return 0;
Is this just to avoid multiple aborted attempts to get the image? Do we expect that ever to happen?
> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:154 > + Image* buttonImage = 0; > + if (plugInImageElement()->hovered()) > + buttonImage = startButtonImage(m_buttonType);
This logic is a bit odd. Why not just early return if not hovered?
> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:245 > + m_buttonRect = tryToFitStartButton(ButtonSizeLarge, rect); > + if (!m_buttonRect.isEmpty()) { > + m_buttonType = ButtonSizeLarge; > + return; > + } > + > + m_buttonRect = tryToFitStartButton(ButtonSizeSmall, rect); > + if (!m_buttonRect.isEmpty()) { > + m_buttonType = ButtonSizeSmall; > + return; > + } > + > + m_buttonType = NoButton;
I'm not sure why you have to run this logic at layout time. Can't you just choose what to paint at paint time?
Jon Lee
Comment 17
2012-12-07 14:20:34 PST
Comment on
attachment 178228
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=178228&action=review
>> Source/WebCore/page/ChromeClient.h:376 >> + virtual PassRefPtr<Image> generatePlugInStartButtonImage(RenderSnapshottedPlugIn::ButtonSize) const { return 0; } > > Why 'generate'? Why not just plugInStartButtonImage() ?
Renamed. This was originally connected to the idea that via the WK2 API we have to copy the data to a bitmap image every time we make this call, but since the code already caches those images, this is less important.
>> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:138 >> + return 0; > > Is this just to avoid multiple aborted attempts to get the image? Do we expect that ever to happen?
If a client decides not to provide an image, then we will already ask for it. So I wanted to avoid that. Clients that implement this probably will provide all buttons.
>> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:154 >> + buttonImage = startButtonImage(m_buttonType); > > This logic is a bit odd. Why not just early return if not hovered?
Yes, I've updated the logic here.
>> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:245 >> + m_buttonType = NoButton; > > I'm not sure why you have to run this logic at layout time. Can't you just choose what to paint at paint time?
I thought it might be less performant to do this on every paint, but I can move it. Moving it would also obviate the need for these instance variables.
Jon Lee
Comment 18
2012-12-09 02:44:05 PST
Committed
r137067
: <
http://trac.webkit.org/changeset/137067
>
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