Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify the mapping of containing block to element #30

Open
hawkinsw opened this issue Aug 1, 2019 · 4 comments
Open

Specify the mapping of containing block to element #30

hawkinsw opened this issue Aug 1, 2019 · 4 comments

Comments

@hawkinsw
Copy link
Contributor

hawkinsw commented Aug 1, 2019

With respect to the proposal to use "nearest containing block ancestor" as the way to aggregate text nodes:

The containing block is a rectangle, not an element, and the mapping between rectangles and elements is not trivial

  1. a single element can map to multiple containing blocks,
  2. a single containing block might not map to any specific element at all (e.g. this is what you get if a table-row cell contains several block-and-text children: you get an anonymous table-cell box which determines the containing block for those blocks-and-text, but that box does not correspond to any elements).

Can we specify the mapping from containing blocks to elements?

@npm1
Copy link
Collaborator

npm1 commented Aug 7, 2019

Thanks for the feedback! Interesting, anonymous layout objects are definitely a problem here. Any suggestions on how we can fix this? For example, could we consider the nearest element ancestor?

@bzbarsky
Copy link

bzbarsky commented Aug 7, 2019

Parent element (the parent of a textnode that's bound to the document tree is always an element) is easy enough to do. Would it produce the right behavior?

One thing to consider: how do textnodes fundamentally differ from inline elements (replaced or non-replaced), apart from not being elements?

@npm1
Copy link
Collaborator

npm1 commented Aug 13, 2019

Parent elements does not work like we'd like it to, for example consider the following paragraph:
<p>See the <a href...>link</a>.</p>
We want link to be grouped with p, hence why we used containing block (to attempt to visually group text elements).

One thing to consider: how do textnodes fundamentally differ from inline elements (replaced or non-replaced), apart from not being elements?

Not sure I understand the message here.

@bzbarsky
Copy link

Not sure I understand the message here.

I think that question was due to not really checking how the association of text to containing block is used. Looks like it's pretty text-specific....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants