Bug 93556 - Page popups can show up at wrong locations
Summary: Page popups can show up at wrong locations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keishi Hattori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-08 17:07 PDT by Keishi Hattori
Modified: 2012-08-09 05:43 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.75 KB, patch)
2012-08-08 18:34 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Screenshot (67.51 KB, image/png)
2012-08-09 00:19 PDT, Keishi Hattori
no flags Details
Patch (8.33 KB, patch)
2012-08-09 01:01 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (7.31 KB, patch)
2012-08-09 01:25 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (7.53 KB, patch)
2012-08-09 01:43 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keishi Hattori 2012-08-08 17:07:28 PDT
ColorChooserUIController::contentSize is returning a size that is too big.
Comment 1 Keishi Hattori 2012-08-08 18:34:23 PDT
Created attachment 157360 [details]
Patch
Comment 2 Kent Tamura 2012-08-09 00:15:18 PDT
I'm not sure why this problem happens.  We have a code to adjust position on resizing in PagePopupChromeClient::setWindowRect().
Comment 3 Keishi Hattori 2012-08-09 00:19:57 PDT
Created attachment 157405 [details]
Screenshot

It seems to be because there isn't enough room above the element.
Comment 4 Kent Tamura 2012-08-09 00:29:30 PDT
(In reply to comment #3)
> Created an attachment (id=157405) [details]
> Screenshot
> 
> It seems to be because there isn't enough room above the element.

ok, I understand. We have no enough room both below the element and above the element, and the current algorithm in setWindowRect() can't correct the bottom position.

IMO, reposition() should be called in PagePopupChromeClient::setWindowRect(), not in WebPagePopupImpl::resize(), and we can remove the current code of PagePopupChromeClient::setWindowRect().
Comment 5 Kent Tamura 2012-08-09 00:31:38 PDT
Comment on attachment 157360 [details]
Patch

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

> Source/WebCore/Resources/colorSuggestionPicker.js:94
>      var errorString = validateArguments(args);
> -    if (errorString)
> +    if (errorString) {
>          main.textContent = "Internal error: " + errorString;
> -    else
> +        updateWindowSize();
> +    } else {
>          new ColorPicker(main, args);
> +    }
>  }

It seems this change is not related to this bug. Do you need to change WebCore to fix this bug?
Comment 6 Keishi Hattori 2012-08-09 00:59:20 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Created an attachment (id=157405) [details] [details]
> > Screenshot
> > 
> > It seems to be because there isn't enough room above the element.
> 
> ok, I understand. We have no enough room both below the element and above the element, and the current algorithm in setWindowRect() can't correct the bottom position.
> 
> IMO, reposition() should be called in PagePopupChromeClient::setWindowRect(), not in WebPagePopupImpl::resize(), and we can remove the current code of PagePopupChromeClient::setWindowRect().

It would be too late to call reposition in setWindowRect, because setWindowRect takes the screen rect and we can only know the screen rect by calling reposition.
Comment 7 Keishi Hattori 2012-08-09 01:00:17 PDT
(In reply to comment #5)
> (From update of attachment 157360 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=157360&action=review
> 
> > Source/WebCore/Resources/colorSuggestionPicker.js:94
> >      var errorString = validateArguments(args);
> > -    if (errorString)
> > +    if (errorString) {
> >          main.textContent = "Internal error: " + errorString;
> > -    else
> > +        updateWindowSize();
> > +    } else {
> >          new ColorPicker(main, args);
> > +    }
> >  }
> 
> It seems this change is not related to this bug. Do you need to change WebCore to fix this bug?

If we return 0x0 for contentSize we won't be able to see the error message.
Comment 8 Keishi Hattori 2012-08-09 01:01:56 PDT
Created attachment 157411 [details]
Patch
Comment 9 Kent Tamura 2012-08-09 01:04:06 PDT
(In reply to comment #7)
> (In reply to comment #5)
> > (From update of attachment 157360 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=157360&action=review
> > 
> > > Source/WebCore/Resources/colorSuggestionPicker.js:94
> > >      var errorString = validateArguments(args);
> > > -    if (errorString)
> > > +    if (errorString) {
> > >          main.textContent = "Internal error: " + errorString;
> > > -    else
> > > +        updateWindowSize();
> > > +    } else {
> > >          new ColorPicker(main, args);
> > > +    }
> > >  }
> > 
> > It seems this change is not related to this bug. Do you need to change WebCore to fix this bug?
> 
> If we return 0x0 for contentSize we won't be able to see the error message.

We never show the error message to end users as far as we know, right?  This change should be done in a separated patch.
Comment 10 Kent Tamura 2012-08-09 01:07:20 PDT
Comment on attachment 157411 [details]
Patch

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

> Source/WebKit/chromium/src/ColorChooserUIController.cpp:95
> -    return WebCore::IntSize(300, 300);
> +    return WebCore::IntSize(0, 0);

Would you update CalendarPickerElement::contentSize too please?

> Source/WebKit/chromium/src/WebPagePopupImpl.cpp:241
> +        m_isPutAboveOrigin = true;

We can remove WebPagePopupImpl::m_isPutAboveOrigin.
Comment 11 Keishi Hattori 2012-08-09 01:25:28 PDT
Created attachment 157420 [details]
Patch
Comment 12 Keishi Hattori 2012-08-09 01:25:37 PDT
> We never show the error message to end users as far as we know, right?  This change should be done in a separated patch.
Done.
(In reply to comment #10)
> (From update of attachment 157411 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=157411&action=review
> 
> > Source/WebKit/chromium/src/ColorChooserUIController.cpp:95
> > -    return WebCore::IntSize(300, 300);
> > +    return WebCore::IntSize(0, 0);
> 
> Would you update CalendarPickerElement::contentSize too please?
Done.
> > Source/WebKit/chromium/src/WebPagePopupImpl.cpp:241
> > +        m_isPutAboveOrigin = true;
> 
> We can remove WebPagePopupImpl::m_isPutAboveOrigin.
Done.
Comment 13 Kent Tamura 2012-08-09 01:28:07 PDT
Comment on attachment 157420 [details]
Patch

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

> Source/WebKit/chromium/ChangeLog:3
> +        Color suggestion popup shows up in wrong locations

Should be updated.

> Source/WebKit/chromium/ChangeLog:8
> +        We need to reposition the page popup every time we resize it.

We had better explain what was wrong.
Comment 14 Keishi Hattori 2012-08-09 01:43:18 PDT
Created attachment 157425 [details]
Patch
Comment 15 WebKit Review Bot 2012-08-09 05:43:38 PDT
Comment on attachment 157425 [details]
Patch

Clearing flags on attachment: 157425

Committed r125169: <http://trac.webkit.org/changeset/125169>
Comment 16 WebKit Review Bot 2012-08-09 05:43:41 PDT
All reviewed patches have been landed.  Closing bug.