Bug 132883 - Update positioning/drawing of the image controls button
Summary: Update positioning/drawing of the image controls button
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-13 13:24 PDT by Brady Eidson
Modified: 2014-05-13 14:46 PDT (History)
6 users (show)

See Also:


Attachments
Patch v1 (5.23 KB, patch)
2014-05-13 13:31 PDT, Brady Eidson
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-05-13 13:24:15 PDT
Update positioning/drawing of the image controls button

<rdar://problem/16885077>
Comment 1 Brady Eidson 2014-05-13 13:31:47 PDT
Created attachment 231404 [details]
Patch v1
Comment 2 Tim Horton 2014-05-13 13:36:09 PDT
Comment on attachment 231404 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=231404&action=review

> Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp:101
> +    button->setAttribute(HTMLNames::styleAttr, String::format("right: %ipx; top: %ipx", positionOffset.width(), positionOffset.height()));

Is this the normal way to set style attributes? I think you should be using setInlineStyleProperty for efficiency. See my use in PDFPluginTextAnnotation.

> Source/WebCore/html/shadow/mac/imageControlsMac.css:-32
> -    right: 18px; /* FIXME: Why is right: 0px off the right edge of the parent? */

we should keep a comment about this nonsense, because it's still wrong. just... above.
Comment 3 Brady Eidson 2014-05-13 13:44:16 PDT
https://trac.webkit.org/changeset/168728
Comment 4 Tim Horton 2014-05-13 13:51:20 PDT
(In reply to comment #2)
> (From update of attachment 231404 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=231404&action=review
> 
> > Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp:101
> > +    button->setAttribute(HTMLNames::styleAttr, String::format("right: %ipx; top: %ipx", positionOffset.width(), positionOffset.height()));
> 
> Is this the normal way to set style attributes? I think you should be using setInlineStyleProperty for efficiency. See my use in PDFPluginTextAnnotation.
> 
> > Source/WebCore/html/shadow/mac/imageControlsMac.css:-32
> > -    right: 18px; /* FIXME: Why is right: 0px off the right edge of the parent? */
> 
> we should keep a comment about this nonsense, because it's still wrong. just... above.

I meant, to avoid String::formats :D

setInlineStyleProperty(CSSPropertyTop, positionOffset.height(), CSS_PX);

etc.
Comment 5 Brady Eidson 2014-05-13 14:46:20 PDT
Followed up in https://trac.webkit.org/changeset/168742