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

inline-block + position:relative: top value is 3 time bigger than expected #7067

Closed
paulrouget opened this issue Aug 7, 2015 · 0 comments
Closed
Labels
A-layout/block I-wrong An incorrect behaviour is observed.

Comments

@paulrouget
Copy link
Contributor

In this example, the y coordinate of the div is always 3 times bigger than the top value.

<!DOCTYPE html>

<html>

  <style>
    div {
      display: inline-block;
      position: relative;
      top: 20px;
      width: 20px;
      height: 20px;
      background: red;
    }
  </style>

  <body>
    <div></div>
  </body>

</html>

screen shot 2015-08-07 at 12 07 30

@frewsxcv frewsxcv added I-wrong An incorrect behaviour is observed. A-layout/block labels Aug 7, 2015
pcwalton added a commit to pcwalton/servo that referenced this issue Aug 11, 2015
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

Closes servo#7067.
pcwalton added a commit to pcwalton/servo that referenced this issue Aug 11, 2015
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

Closes servo#7067.
pcwalton added a commit to pcwalton/servo that referenced this issue Aug 11, 2015
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

This commit also removes the `cascade_anonymous` function and the
related `Fragment` constructor. They were unused, and their
functionality has been replaced by the `modify_style_for_*` series of
functions.

Closes servo#7067.
pcwalton added a commit to pcwalton/servo that referenced this issue Aug 12, 2015
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

This commit also removes the `cascade_anonymous` function and the
related `Fragment` constructor. They were unused, and their
functionality has been replaced by the `modify_style_for_*` series of
functions.

Closes servo#7067.
bors-servo pushed a commit that referenced this issue Aug 12, 2015
…beck

layout: Take relative position offsets for inlines and inline-blocks into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

Closes #7067.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7150)
<!-- Reviewable:end -->
fabricedesre pushed a commit to fabricedesre/servo that referenced this issue Aug 14, 2015
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

This commit also removes the `cascade_anonymous` function and the
related `Fragment` constructor. They were unused, and their
functionality has been replaced by the `modify_style_for_*` series of
functions.

Closes servo#7067.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-layout/block I-wrong An incorrect behaviour is observed.
Projects
None yet
Development

No branches or pull requests

2 participants