mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #5805 - pcwalton:whitespace-effect-on-minimum-inline-sizes, r=glennw
Improves Amazon. r? @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5805) <!-- Reviewable:end -->
This commit is contained in:
commit
68f03c9dbb
5 changed files with 154 additions and 7 deletions
|
@ -16,8 +16,7 @@ use flow_ref::FlowRef;
|
|||
use incremental::{self, RestyleDamage};
|
||||
use inline::{InlineFragmentContext, InlineMetrics};
|
||||
use layout_debug;
|
||||
use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
|
||||
use model;
|
||||
use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
|
||||
use text;
|
||||
use opaque_node::OpaqueNodeMethods;
|
||||
use wrapper::{TLayoutNode, ThreadSafeLayoutNode};
|
||||
|
@ -1200,7 +1199,6 @@ impl Fragment {
|
|||
}
|
||||
SpecificFragmentInfo::ScannedText(ref text_fragment_info) => {
|
||||
let range = &text_fragment_info.range;
|
||||
let min_line_inline_size = text_fragment_info.run.min_width_for_range(range);
|
||||
|
||||
// See http://dev.w3.org/csswg/css-sizing/#max-content-inline-size.
|
||||
// TODO: Account for soft wrap opportunities.
|
||||
|
@ -1208,6 +1206,11 @@ impl Fragment {
|
|||
.metrics_for_range(range)
|
||||
.advance_width;
|
||||
|
||||
let min_line_inline_size = match self.style.get_inheritedtext().white_space {
|
||||
white_space::T::pre | white_space::T::nowrap => max_line_inline_size,
|
||||
white_space::T::normal => text_fragment_info.run.min_width_for_range(range),
|
||||
};
|
||||
|
||||
result.union_block(&IntrinsicISizes {
|
||||
minimum_inline_size: min_line_inline_size,
|
||||
preferred_inline_size: max_line_inline_size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue