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

initial implement for inline background #1494

Merged
merged 2 commits into from
Jan 16, 2014
Merged

Conversation

ksh8281
Copy link
Contributor

@ksh8281 ksh8281 commented Jan 15, 2014

initial implement for inline background
it makes same result in "src/test/html/inline_bg_color_simple.html" with firefox

@hoppipolla-critic-bot
Copy link

Critic review: https://critic.hoppipolla.co.uk/r/553

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@highfive
Copy link

warning Warning warning

  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!
  • @ksh8281, please confirm that src/test/html/acid1.html and your favourite wikipedia page still render correctly!

@SimonSapin
Copy link
Member

Do you mean background-color on elements with display: inline?

@ksh8281
Copy link
Contributor Author

ksh8281 commented Jan 15, 2014

@SimonSapin yes. it is

@bzbarsky
Copy link
Contributor

Doing inline backgrounds correctly and fast in anything but the solid-color case is slightly rocket-science because of block-in-inline splits and line-breaking... We should figure out how to do this well.

// FIXME: This causes a lot of background colors to be displayed when they are clearly not
// needed. We could use display list optimization to clean this up, but it still seems
// inefficient. What we really want is something like "nearest ancestor element that
// doesn't have a box".


self.inline_info.with( |info| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of .with, could you use .borrow() and then .get()? Like this:

let info = self.inline_info.borrow();
match info.get() {
    &Some(ref box_info) => {
    ... etc ...
}

That way the code won't be smushed so far to the right.

bors-servo pushed a commit that referenced this pull request Jan 16, 2014
initial implement for inline background
it makes same result in "src/test/html/inline_bg_color_simple.html" with firefox
bors-servo pushed a commit that referenced this pull request Jan 16, 2014
initial implement for inline background
it makes same result in "src/test/html/inline_bg_color_simple.html" with firefox
@bors-servo bors-servo merged commit 6364103 into servo:master Jan 16, 2014
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

Successfully merging this pull request may close these issues.

None yet

7 participants