Re: [csswg-drafts] [resize-observer] ResizeObserver should support fragments (#3673)

Re: reporting fragment size as array of sizes

Current proposal: object
`borderSize: { inline: ,block: }`
mutates to an array if target becomes fragmented
`borderSize: [ { inline: ,block: }`

My concern is this: 

If webdevs wrote their RO handler without taking fragmentation into account like this:

    new ResizeObserver(entries => {
      let newBorderWidth = entries[0].borderSize.inline / 10;
    },

their code would break if borderSize became an array.

I believe most webdevs will not write fragmentation-compatible code.

To minimize breakage of fragmented components that use ResizeObserver, I propose that developers should explicitly opt-in to fragment support. This can be done by adding a new option to RO.observer `fragments: false/true.`. If fragments is true, sizes would always be reported as an array.



-- 
GitHub Notification of comment by atotic
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3673#issuecomment-466819760 using your GitHub account

Received on Sunday, 24 February 2019 21:38:15 UTC