Skip to content

Adding margin support to attemptChangeSize #6626

@tlong2

Description

@tlong2

Unless there are any objections, I'd like to add the ability to specify new margin sizes to the attemptChangeSize function in resources-impl.js.

This would change it to something like:
/**

  • @param {!Element} element
  • @param {number|undefined} newHeight
  • @param {number|undefined} newWidth
  • @param {number|undefined} newMarginTop
  • @param {number|undefined} newMarginBottom
  • @return {!Promise}
  • @Protected
    */
    attemptChangeSize(element, newHeight, newWidth, newMarginTop, newMarginBottom) {
    ...
    }

The mutateWork_() function would then include any margin changes in its calculation of the height increase and allow/disallow the size change and adjust any scrolling accordingly. This will probably require adding knowledge of margins to resource.js. They can be determined using window.getComputedStyle().

This will be useful for the feature: #6196

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions