[webkit-reviews] review granted: [Bug 125069] Web Inspector: popover can overlap target frame : [Attachment 218154] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 2 10:28:48 PST 2013


Joseph Pecoraro <joepeck at webkit.org> has granted Antoine Quint
<graouts at apple.com>'s request for review:
Bug 125069: Web Inspector: popover can overlap target frame
https://bugs.webkit.org/show_bug.cgi?id=125069

Attachment 218154: Patch
https://bugs.webkit.org/attachment.cgi?id=218154&action=review

------- Additional Comments from Joseph Pecoraro <joepeck at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=218154&action=review


> Source/WebInspectorUI/UserInterface/Popover.js:404
> +	   if (edge === WebInspector.RectEdge.MIN_X || edge ===
WebInspector.RectEdge.MAX_X) {
> +	       if (y < containerFrame.minY())
> +		   y = containerFrame.minY();
> +	       if (y + height > containerFrame.maxY())
> +		   y += containerFrame.maxY() - (y + height);
> +	   } else {
> +	       if (x < containerFrame.minX())
> +		   x = containerFrame.minX(); 
> +	       if (x + width > containerFrame.maxX())
> +		   x += containerFrame.maxX() - (x + width);
> +	   }

I don't understand this section:

    if (popover is above or below) {
	if (y < min)
	  y = min;
	if (y + height > max)
	  y = y + max - y + height;
    }

My confusion is with the second case.

1. The adjustment is basically "y = max - height". Is there any guarantee that
after that we will still have "y > min"? If so, should we clamp height, or
would that cause other problems?
2. The "+=" statement makes this more confusing then it needs to be. Just make
it an assignment and drop the inner y.

I'm fine as long as (2) is handled. I assume (1) is not actually a problem. So
I'd like to see that last statement be just: (likewise simplifying the "x"
case)

    y = containerFrame.maxY() - height;


More information about the webkit-reviews mailing list