Bug 173913 - Overflow percentage widths calculated incorrectly
Summary: Overflow percentage widths calculated incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 10
Hardware: iPhone / iPad iOS 10.3
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-28 00:22 PDT by Chris Lienert
Modified: 2017-07-10 20:21 PDT (History)
2 users (show)

See Also:


Attachments
Correct behaviour in MacOS (270.58 KB, image/png)
2017-06-28 00:22 PDT, Chris Lienert
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lienert 2017-06-28 00:22:56 PDT
Created attachment 314000 [details]
Correct behaviour in MacOS

Steps to reproduce the problem:
Over-sized elements calculate percentages based on when overflow is applied.

See https://codepen.io/cliener/pen/PjjJYM?editors=1100#0

What is the expected behavior?
Percentage widths should be calculated on the width of the parent instead of the element itself.

For example, if the window width is 1000px and the over-sized element 1400px, setting width of 50% on the over-sized element should set the width to 500px.

What went wrong?
Widths are calculated on the width of the element not of the parent.

Following the example above, if the window width is 1000px and the over-sized element 1400px, setting width of 50% on the over-sized element sets the width to 700px.

Did this work before?
Safari 10.1.1 MacOS calculates the value correctly. Safari in iOS 10.3.2 does not. Unsure about earlier versions.
Comment 1 Simon Fraser (smfr) 2017-06-29 08:11:51 PDT
Does this reproduce in a recent Safari Tech Preview?
Comment 2 Chris Lienert 2017-07-10 20:21:05 PDT
(In reply to Simon Fraser (smfr) from comment #1)
> Does this reproduce in a recent Safari Tech Preview?

Not relevant to tech previews since it only occurs in iOS. Haven't tested in iOS 11 beta(s)