W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

Re: [csswg-drafts] [css-shapes] Specify algorithms for computing line-box intrusion into float's margin box.

From: Ian Kilpatrick via GitHub <sysbot+gh@w3.org>
Date: Wed, 25 Jul 2018 17:18:29 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-407830412-1532539108-sysbot+gh@w3.org>
Basically because of subtle implementation differences, we'll end up with implementations that mostly match, but that get edges cases wrong. (see history of CSS2 :P).

This is mozilla's entry point for the above algorithm:
https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsFloatManager.cpp?q=%2Bfunction%3A%22nsFloatManager%3A%3AShapeInfo%3A%3ALineEdge%28const+nsTArray%3CnsRect%3E+%26%2C+const+nscoord%2C+const+nscoord%2C+bool%29%22&redirect_type=single#541
... and this is blink's
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/shapes/shape.h?sq=package:chromium&g=0&l=92

This algorithm I'm after is you have some float, for a given line-box, how far into that shape can I go?

The algorithms in the implementations are similar, but not exactly the same. E.g. they apply shape-margins at different stages (probably leading to different results), testing intersection with images looks like they'll behave differently, etc.

I realize this is a lot of work to write down, and make sure all the edge cases work correctly, but this will mean that implementations can work towards what's in the specification, and another implementation will be able to easily implement without spending many engineering hours coming up with similar (but perhaps subtlety different algorithms).

If we write down these algorithms, it'll be easy to find answers to the questions on the call such as what happens when polygons create -ve area, etc, and easy for implementations to implement the desired behaviour.


-- 
GitHub Notification of comment by bfgeek
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2949#issuecomment-407830412 using your GitHub account
Received on Wednesday, 25 July 2018 17:18:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 25 July 2018 17:18:50 UTC