Commit graph

500 commits

Author SHA1 Message Date
Patrick Walton
c86bc2eb8b layout: Don't take collapsible top margin into account when determining
the float ceiling.

As the float ceiling is relative to the border box, not the margin box,
of the parent flow, top margin must not be included.

This exposed a pre-existing bug whereby margins are discarded if a block
contains only floats and no content, affecting the tests
`float_intrinsic_height.html` and `margins_inside_floats_a.html`. As a
workaround, some invisible content has been added to the bodies of both
tests.
2015-04-07 15:10:15 -07:00
Patrick Walton
e10af4fc98 layout: Correctly take the inline size of cleared floats into account
when estimating the inline size of block formatting contexts.

The speculated inline-size of the preceding floats was forced to zero at
the wrong time if the float was itself cleared, causing it to overwrite
the speculated value. Shuffling the code around a bit fixes the problem.
2015-04-06 17:59:14 -07:00
Ms2ger
b50b21d1da Stop using int/uint in net_traits. 2015-04-06 16:08:53 +02:00
Matt Brubeck
791fa3757d Implement the :focus pseudo-class selector
Fixes #5460. This supports for simple focusable elements that are their own
DOM anchors, like text `input` fields.
2015-04-04 10:57:11 -07:00
Gilles Leblanc
ba36a108c1 Split out shared networking code into net_traits crate
Fixes #4476
2015-04-03 13:38:10 -04:00
aditya
a3eaacccf6 Move iframe and url fields from Reflow to LayoutTask and LayoutTaskFactory
* Fix #5466
2015-04-02 16:09:48 -04:00
Ms2ger
a65c80231a Stop using u/i suffixes in layout. 2015-04-02 15:14:09 +02:00
Ms2ger
7fabf6071e Use usize in generated_content. 2015-04-02 15:06:27 +02:00
Ms2ger
8a8aee8576 Use usize in StopRun. 2015-04-02 15:05:27 +02:00
Ms2ger
2951455d18 Use usize for canvas sizes. 2015-04-02 15:04:29 +02:00
Ms2ger
683749c999 Use isize for Au::from_px. 2015-04-02 15:02:37 +02:00
Ms2ger
7b45a4384d Use a u32 in calculate_split_position_using_breaking_strategy. 2015-04-02 14:59:26 +02:00
Ms2ger
d418c0da3a Cleanup convert_length in ImageFragmentInfo. 2015-04-02 14:57:44 +02:00
Ms2ger
37b5e78a2c Avoid a cast in LayoutImageResponder. 2015-04-02 14:56:05 +02:00
Ms2ger
31c6a3977f Use usize in flow.rs. 2015-04-02 14:55:43 +02:00
Ms2ger
588143149c Use u32 for ImmutableFlowUtils::dump_with_level. 2015-04-02 14:55:25 +02:00
Ms2ger
a0ad6ba2d4 Use usize for indices into InlineFragments. 2015-04-02 14:53:30 +02:00
Ms2ger
232dadc81d Use isize for FragmentIndex. 2015-04-02 14:53:10 +02:00
Ms2ger
2cc3c1d9c2 Use isize with children_count members.
I'm not size why these are signed.
2015-04-02 14:50:15 +02:00
Ms2ger
67b3a3d3d6 Use usize for propagate_to_child. 2015-04-02 14:47:48 +02:00
Ms2ger
3dd3ad728e Use u32 for TableColumnFragmentInfo::span. 2015-04-02 14:46:19 +02:00
Ms2ger
6d7dead4ef Use isize for CharIndex. 2015-04-02 14:45:49 +02:00
Ms2ger
cd8c03bb49 Use usize for layout node debug ids. 2015-04-02 14:21:33 +02:00
Patrick Walton
4011291bf2 layout: Stop rebuilding all inline-block flows unconditionally, and
bubble intrinsic inline sizes as necessary when doing incremental
reflow.
2015-04-01 10:52:15 -07:00
Patrick Walton
750bbed2cb gfx: Perform more aggressive caching in
`FontContext::get_layout_font_group_for_style()`.

There are several optimizations here:

* We make font families atoms, to allow for quicker comparisons.

* We precalculate an FNV hash of the relevant fields of the font style
  structure.

* When obtaining a platform font group, we first check pointer equality
  for the font style. If there's no match, we go to the FNV hash. Only
  if both caches miss do we construct and cache a font group. Note that
  individual fonts are *also* cached; thus there are two layers of
  caching here.

15% improvement in total layout thread time for Facebook Timeline.
2015-04-01 08:58:16 -07:00
bors-servo
8976bbfe7d auto merge of #5441 : servo/servo/heap-unclassified, r=jdm 2015-03-31 15:03:56 -06:00
bors-servo
b79d06c8d2 auto merge of #5349 : mbrubeck/servo/placement-size, r=pcwalton
I think this should have been changed in #3618 but was missed. r? @pcwalton

I wasn't able to come up with a good test case for this, partly because of other bugs related to floats and formatting contexts.
2015-03-31 14:15:59 -06:00
Patrick Walton
66dd8c8a6c layout: Implement CSS transitions per CSS-TRANSITIONS § 2.
Transition events are not yet supported, and the only animatable
properties are `top`, `right`, `bottom`, and `left`. However, all other
features of transitions are supported. There are no automated tests at
present because I'm not sure how best to test it, but three manual tests
are included.
2015-03-31 08:46:11 -07:00
Nicholas Nethercote
66902d2c90 Use usize rather than u64 in MemoryReport.
I should have used usize in the first place.
2015-03-31 15:37:15 +02:00
Patrick Walton
16db7bab28 layout: Stop going to the DOM to determine the root flow's background
color.

This allows us to do layout off the main thread, which is necessary for
transitions.
2015-03-30 10:00:32 -07:00
bors-servo
39556cc832 auto merge of #5422 : bdero/servo/bdero/box-syntax, r=jdm
Closes #5417
2015-03-29 17:10:01 -06:00
Brandon DeRosier
ccc55d658f Use box syntax instead of Box::new()
Closes #5417
2015-03-29 13:41:14 -04:00
Ms2ger
865d4b4eb4 Use usize for UnsafeFlow. 2015-03-29 12:51:27 +02:00
Ms2ger
95004ee4b6 Use usize for Floats::len. 2015-03-29 12:47:25 +02:00
Ms2ger
d2252a7214 Use usize for cache indices. 2015-03-29 12:46:28 +02:00
Ms2ger
803eba0e59 Use usize for cache sizes. 2015-03-29 12:45:19 +02:00
Ms2ger
339ab881a2 Use usize in ApplicableDeclarationsCacheQuery's hash method. 2015-03-29 12:45:07 +02:00
Ms2ger
e39c68e307 Use usize in flow_list. 2015-03-29 12:43:44 +02:00
Ms2ger
9904216d76 Use u32 for generation numbers. 2015-03-28 22:46:16 +01:00
Ms2ger
d521cd006e Remove the unused FloatedBlockInfo::index field. 2015-03-28 22:42:14 +01:00
Ms2ger
da1e3a3f11 Use usize for debug ids. 2015-03-28 22:37:41 +01:00
Ms2ger
40c710ab19 Pass u32 to LayoutNode::dump_indent. 2015-03-28 22:32:43 +01:00
Ms2ger
7a2ab2784d Use usize for UnsafeLayoutNode. 2015-03-28 22:30:55 +01:00
Ms2ger
37c271a260 Use usize and u32 for LayerId. 2015-03-28 15:36:36 +01:00
Ms2ger
43ed033eff Use isize/usize in range. 2015-03-28 15:36:36 +01:00
Fabrice Desré
0580ad9a82 Suppress unused import warnings 2015-03-25 22:57:27 -07:00
bors-servo
d784d9c488 auto merge of #5348 : nnethercote/servo/profiler-renaming, r=jdm
```
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)
```
In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
2015-03-25 21:18:48 -06:00
Nicholas Nethercote
ce36e574f4 Rename lots of profiling-related things.
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)

In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
2015-03-25 16:00:23 -07:00
Ms2ger
b9c4ab6882 Remove old_path usage from layout. 2015-03-25 22:36:01 +01:00
Matt Brubeck
c8b5b5b9c8 Don't add margin/border/padding twice to position
I think this should have been changed in #3618 but was missed.
2015-03-24 17:04:44 -07:00