WebKit Bugzilla
Attachment 357028 Details for
Bug 192577
: Web Inspector: overlay bounds rulers don't match element when page is scrolled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192577-20181210182505.patch (text/plain), 3.66 KB, created by
Devin Rousso
on 2018-12-10 18:25:05 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-10 18:25:05 PST
Size:
3.66 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 92d946d6ef02f6cc2e0ff8596dae119a560e03dc..4b473aa7959bd8008f2b04ca198b2bc5b7257acf 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-12-10 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: overlay bounds rulers don't match element when page is scrolled >+ https://bugs.webkit.org/show_bug.cgi?id=192577 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When drawing the highlight for a node, the canvas is translated based on the scroll position >+ of the node. This translation was not applied to the bounds calculations, which meant that >+ the bounds always drew where the node would have been if it wasn't scrolled. >+ >+ * inspector/InspectorOverlayPage.js: >+ (Bounds.prototype.get minX): >+ (Bounds.prototype.get minY): >+ (Bounds.prototype.get maxX): >+ (Bounds.prototype.get maxY): >+ (Bounds.prototype.offset): Added. >+ (drawNodeHighlight): >+ Drive-by: draw bounds for every node being highlighted instead of just the first one. >+ Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast. >+ > 2018-12-06 Adrian Perez de Castro <aperez@igalia.com> > > Content Extensions: Misc fixes to debugging / perf testing code >diff --git a/Source/WebCore/inspector/InspectorOverlayPage.js b/Source/WebCore/inspector/InspectorOverlayPage.js >index f42c394f6dc46ff581dcde48ac615ce3d80a7e6c..dfefcd3a6570e49278607e94a386c6d2c69000b6 100644 >--- a/Source/WebCore/inspector/InspectorOverlayPage.js >+++ b/Source/WebCore/inspector/InspectorOverlayPage.js >@@ -1,4 +1,4 @@ >-const boundsColor = "rgba(0,0,0,0.4)"; >+const boundsColor = "rgba(255,0,0,0.6)"; > const lightGridColor = "rgba(0,0,0,0.2)"; > const darkGridColor = "rgba(0,0,0,0.5)"; > const transparentColor = "rgba(0, 0, 0, 0)"; >@@ -22,14 +22,17 @@ class Bounds { > this._minY = Number.MAX_VALUE; > this._maxX = Number.MIN_VALUE; > this._maxY = Number.MIN_VALUE; >+ >+ this._offsetX = 0; >+ this._offsetY = 0; > } > > // Public > >- get minX() { return this._minX; } >- get minY() { return this._minY; } >- get maxX() { return this._maxX; } >- get maxY() { return this._maxY; } >+ get minX() { return this._minX + this._offsetX; } >+ get minY() { return this._minY + this._offsetY; } >+ get maxX() { return this._maxX + this._offsetX; } >+ get maxY() { return this._maxY + this._offsetY; } > > update(x, y) > { >@@ -38,6 +41,12 @@ class Bounds { > this._maxX = Math.max(this._maxX, x); > this._maxY = Math.max(this._maxY, y); > } >+ >+ offset(x, y) >+ { >+ this._offsetX = x || 0; >+ this._offsetY = y || 0; >+ } > } > > function drawPausedInDebuggerMessage(message) >@@ -50,9 +59,10 @@ function drawPausedInDebuggerMessage(message) > > function drawNodeHighlight(allHighlights) > { >- let bounds = new Bounds; >- > for (let highlight of allHighlights) { >+ let bounds = new Bounds; >+ bounds.offset(-highlight.scrollOffset.x, -highlight.scrollOffset.y); >+ > _isolateActions(() => { > context.translate(-highlight.scrollOffset.x, -highlight.scrollOffset.y); > >@@ -62,10 +72,10 @@ function drawNodeHighlight(allHighlights) > if (highlight.elementData && highlight.elementData.shapeOutsideData) > _drawShapeHighlight(highlight.elementData.shapeOutsideData, bounds); > }); >- } > >- if (DATA.showRulers) >- _drawBounds(bounds); >+ if (DATA.showRulers) >+ _drawBounds(bounds); >+ } > > if (allHighlights.length === 1) { > for (let fragment of allHighlights[0].fragments)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192577
:
357027
| 357028 |
357029