Bug 48216 - Need a way to determine the screen rect for a form control in WebKit2
Summary: Need a way to determine the screen rect for a form control in WebKit2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-10-24 17:39 PDT by Sam Weinig
Modified: 2016-10-30 12:10 PDT (History)
2 users (show)

See Also:


Attachments
Patch (13.44 KB, patch)
2010-10-24 17:43 PDT, Sam Weinig
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2010-10-24 17:39:47 PDT
Need a way to determine the screen rect for a form control in WebKit2. In old WebKit, Safari on Mac used [DOMHTMLInputElement _rectOnScreen] in DOMPrivate.h.
Comment 1 Sam Weinig 2010-10-24 17:43:40 PDT
Created attachment 71703 [details]
Patch
Comment 2 Sam Weinig 2010-10-24 17:43:58 PDT
<rdar://problem/8530670>
Comment 3 WebKit Review Bot 2010-10-24 17:52:13 PDT
Attachment 71703 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:33:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 mitz 2010-10-24 17:56:00 PDT
Comment on attachment 71703 [details]
Patch

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

> WebCore/dom/Element.cpp:485
> +    IntRect result = quads[0].enclosingBoundingBox();
> +    for (size_t i = 1; i < quads.size(); ++i)
> +        result.unite(quads[i].enclosingBoundingBox());

Can just start with the empty rect and start the loop from 0, but I guess this is slightly more efficient.

> WebCore/dom/Element.cpp:489
> +    FrameView* view = document()->view();
> +    if (!view)
> +        return IntRect();

This can go closer to the beginning.

> WebKit2/WebKit2.xcodeproj/project.pbxproj:481
> -			remoteGlobalIDString = C0CE72851247E66800BC0EC4 /* Derived Sources */;
> +			remoteGlobalIDString = C0CE72851247E66800BC0EC4;

Don’t land this.
Comment 5 Sam Weinig 2010-10-24 18:10:57 PDT
Landed in http://trac.webkit.org/changeset/70428.
Comment 6 Simon Fraser (smfr) 2016-10-30 12:10:22 PDT
Why didn't this share code with clientRect() or getBoundingClientRect()?