Skip to content

Implement 'align' attribute for <div> elements - #7953

Merged
bors-servo merged 1 commit into
servo:masterfrom
frewsxcv:htmldivelement-align
Oct 10, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
frewsxcv:htmldivelement-align

Conversation

@frewsxcv

Copy link
Copy Markdown
Contributor

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 10, 2015
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@frewsxcv

Copy link
Copy Markdown
Contributor Author

So I need a little help with this.

At the time of writing, this test fails after this pull request:
tests/wpt/metadata/html/rendering/non-replaced-elements/flow-content-0/div-align.html

I'm actually not even sure how it was passing prior to this getting implemented. I'm guessing it fails now because this isn't implemented? If anyone has any thoughts, please let me know, thanks.

@eefriedman

Copy link
Copy Markdown
Contributor

See

div[align=left i] { text-align: -servo-left; }
. See also #7825.

I don't think there's any reason to move the rendering rule from presentational-hints.css to synthesize_presentational_hints_for_legacy_attributes.

@nox nox closed this Oct 10, 2015
@nox nox reopened this Oct 10, 2015
@nox

nox commented Oct 10, 2015

Copy link
Copy Markdown
Contributor

I don't think there's any reason to move the rendering rule from presentational-hints.css to synthesize_presentational_hints_for_legacy_attributes.

Not all presentational hints can be expressed through CSS, though.

@frewsxcv

Copy link
Copy Markdown
Contributor Author

Will those CSS hints work correctly with the IDL/content getters/setters? Also, align=center is not part of the spec

@nox

nox commented Oct 10, 2015

Copy link
Copy Markdown
Contributor

@frewsxcv You sure?

The center element, and the div element when it has an align attribute whose value is an ASCII case-insensitive match for either the string "center" or the string "middle", are expected to center text within themselves, as if they had their 'text-align' property set to 'center' in a presentational hint, and to align descendants to the center.

@nox

nox commented Oct 10, 2015

Copy link
Copy Markdown
Contributor

@frewsxcv I'm pretty sure you can just implement reflecting IDL getters and setters and consider that attribute to hold onto a plain old string.

@nox

nox commented Oct 10, 2015

Copy link
Copy Markdown
Contributor

@frewsxcv For other presentational hints, like the one related to the non-zero table border, or fancy color attributes that need to be parsed, we can't avoid going through the synthesis machinery, but I'm pretty sure we prefer going through CSS for the simpler one, as mentioned by @eefriedman.

@frewsxcv

Copy link
Copy Markdown
Contributor Author

You're right. I totally glossed over that first paragraph because I thought it only applied to center elements

@frewsxcv

Copy link
Copy Markdown
Contributor Author

Thanks all for the help, very helpful information to know :)

Force push incoming...

@nox nox added A-content/css Interacting with CSS from web content (parsing, serializing, introspection) A-content/dom Interacting with the DOM from web content labels Oct 10, 2015
@frewsxcv frewsxcv added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 10, 2015
@frewsxcv
frewsxcv force-pushed the htmldivelement-align branch from 96f8612 to 55c65d3 Compare October 10, 2015 12:15
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 10, 2015
@frewsxcv

Copy link
Copy Markdown
Contributor Author

Ready for review

@mbrubeck mbrubeck self-assigned this Oct 10, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor

Reviewed 4 of 4 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from the review on Reviewable.io

@mbrubeck

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 55c65d3 has been approved by mbrubeck

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 10, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 55c65d3 with merge 0dd6556...

bors-servo pushed a commit that referenced this pull request Oct 10, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 10, 2015
@frewsxcv

Copy link
Copy Markdown
Contributor Author

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 55c65d3 with merge babeed9...

bors-servo pushed a commit that referenced this pull request Oct 10, 2015
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 10, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 55c65d3 into servo:master Oct 10, 2015
@frewsxcv
frewsxcv deleted the htmldivelement-align branch October 10, 2015 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-content/css Interacting with CSS from web content (parsing, serializing, introspection) A-content/dom Interacting with the DOM from web content S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants