Changeset 285839 in webkit


Ignore:
Timestamp:
Nov 15, 2021 4:07:03 PM (8 months ago)
Author:
Fujii Hironori
Message:

Web Inspector: Layers Tab: the position of composited layer with box-shadow is wrong
https://bugs.webkit.org/show_bug.cgi?id=233026

Reviewed by Devin Rousso.

If an element has box-shadow, Layers Tab showed the composited
layer positioned wrongly. It assumed the composited layer position
was same with its element position. This isn't true. If an element
has box-shadow, its composited layer includes the surrounding
box-shadow.

  • UserInterface/Models/Layer.js:

(WI.Layer):

  • UserInterface/Views/Layers3DContentView.js:

(WI.Layers3DContentView.prototype._updateLayers):
(WI.Layers3DContentView.prototype._createLayerMesh):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r285711 r285839  
     12021-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        Web Inspector: Layers Tab: the position of composited layer with box-shadow is wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=233026
     5
     6        Reviewed by Devin Rousso.
     7
     8        If an element has box-shadow, Layers Tab showed the composited
     9        layer positioned wrongly. It assumed the composited layer position
     10        was same with its element position. This isn't true. If an element
     11        has box-shadow, its composited layer includes the surrounding
     12        box-shadow.
     13
     14        * UserInterface/Models/Layer.js:
     15        (WI.Layer):
     16        * UserInterface/Views/Layers3DContentView.js:
     17        (WI.Layers3DContentView.prototype._updateLayers):
     18        (WI.Layers3DContentView.prototype._createLayerMesh):
     19
    1202021-11-12  Razvan Caliman  <rcaliman@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Models/Layer.js

    r222342 r285839  
    4242        this._pseudoElement = pseudoElement;
    4343
    44         // FIXME: This should probably be moved to the backend.
    45         this._compositedBounds.x = this._bounds.x;
    46         this._compositedBounds.y = this._bounds.y;
     44        // Transform compositedBounds to the global position
     45        this._compositedBounds.x += this._bounds.x;
     46        this._compositedBounds.y += this._bounds.y;
    4747    }
    4848
  • trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js

    r274033 r285839  
    270270        newLayers.forEach((layer, index) => {
    271271            let layerGroup = this._layerGroupsById.get(layer.layerId);
    272             layerGroup.position.set(layer.bounds.x, -layer.bounds.y, index * zInterval);
     272            layerGroup.position.set(0, 0, index * zInterval);
    273273        });
    274274
     
    287287    }
    288288
    289     _createLayerMesh({width, height}, isOutline = false)
     289    _createLayerMesh({x, y, width, height}, isOutline = false)
    290290    {
    291291        let geometry = new THREE.Geometry;
    292292        geometry.vertices.push(
    293             new THREE.Vector3(0,     0,      0),
    294             new THREE.Vector3(0,     -height, 0),
    295             new THREE.Vector3(width, -height, 0),
    296             new THREE.Vector3(width, 0,      0),
     293            new THREE.Vector3(x, -y, 0),
     294            new THREE.Vector3(x, -y - height, 0),
     295            new THREE.Vector3(x + width, -y - height, 0),
     296            new THREE.Vector3(x + width, -y, 0),
    297297        );
    298298
Note: See TracChangeset for help on using the changeset viewer.