Bug 1022612. Part 1: Always pass a frame to AutoBuildingDisplayList. r=mattwoodrow

--HG--
extra : rebase_source : 7ae8b6e75e0ceeda8afd214e9792a915a21928e3
Bug 1022612. Part 2: Remove unused nsDisplayWrapList constructor. r=mattwoodrow

--HG--
extra : rebase_source : 724f95df1dec4a8c7e1a136e029b06e56eb7202f
Bug 1022612. Part 3: Rename "cached frame" to "current frame" in nsDisplayListBuilder and take advantage of the fact it's always set. r=mattwoodrow

--HG--
extra : rebase_source : cde43a3f358fbb0991ed84d10fc4e1a0de255e9c
Bug 1022612. Part 4: Track current dirty rect in nsDisplayListBuilder. r=mattwoodrow

We need this to set the initial visible rect during display list construction.
Eventually we'll also be able to get rid of the dirty rect parameter to
nsIFrame::BuildDisplayList.

--HG--
extra : rebase_source : b793c7d51917b85ea2a5f39993bc1fec24b49d04
Bug 1022612. Part 5: BuildDisplayListForExtraPage needs to pass the correct dirty rect in. r=mattwoodrow

When printing, every page has the same origin. So doing this change naively
would result in the first page having all the display items for every page
added to it, and all but the first page's display items being pruned
away by PruneDisplayListForExtraPage. This would making printing long documents
very slow. We avoid that problem with the new check for
NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO, so the only pages other than the
current page we descend into are the ones with placeholders for abs-pos content
on the current page.

--HG--
extra : rebase_source : b9b8c53d5ad5e4eb2d3c5e1f407d605558b3b9d0
Bug 1022612. Part 6: Set the initial mVisibleRect for each display item to the dirty rect when we create the item. r=mattwoodrow

--HG--
extra : rebase_source : b3207861e7476e954a8869a8b2d74e642ea6e56b
Bug 1022612. Part 7: Enable APZC for IPC reftests. r=billm

--HG--
extra : rebase_source : 3032baafc1ec69212c8d920b0795cff04f50fb87
Bug 1022612. Part 8: nsDisplayWrapList (but not subclasses) should return true for ShouldFlattenAway. r=mattwoodrow

Also the assertion in TryMerge is going away because we're going to do TryMerge
first in FrameLayerBuilder.

--HG--
extra : rebase_source : de8a1a620279182bf5e33165aa9bbe9a74c08a73
Bug 1022612. Part 9: nsDisplayScrollInfoLayer destructor does not need to destroy ScrollLayerCount. r=mattwoodrow

Getting the timing of this right without processing display items in reverse
order is hard. But it doesn't matter if this property sticks around anyway.

--HG--
extra : rebase_source : a5a68cc0184209506b5c842bf3c5b90648aae159
Bug 1022612. Part 10: Implement merging and flattening in ProcessDisplayItems. r=mattwoodrow

BuildContainerLayerFor now has to be able to mutate the passed-in display item
list.

--HG--
extra : rebase_source : a3cf9106703d4946a49a73ef60a605f72b2afee3
Bug 1022612. Part 11: Set opaque flag on nsDisplayList if we find an opaque item that covers the whole list. r=mattwoodrow

This is less general than what nsDisplayItem::ComputeVisibility does. This means
if multiple opaque items together cover the list bounds, but not individually,
we won't mark the list as opaque. I think that should be OK.

--HG--
extra : rebase_source : 947fe7bfe8729703ebd46288dfa29f0935fadf87
Bug 1022612. Part 12: Propagate NeedsTransparentSurface in ProcessDisplayItems. r=mattwoodrow

--HG--
extra : rebase_source : e740f6a911e665473feca002711853351ca3e078
Bug 1022612. Part 13: Set mDidComputeVisibility in ProcessDisplayItems. r=mattwoodrow

--HG--
extra : rebase_source : c17d6f4c83b9a47c8d3158203ebe0cbff8d2d313
Bug 1022612. Part 14: Don't compute a final transparent region anymore. r=mattwoodrow

Computing this via FrameLayerBuilder is some work and we don't really have to.

SuppressComponentAlpha will be true in more cases. This will be OK as long as
text in the chrome window is over opaque content in the same ThebesLayer. We
will miss some edge cases such as text in 'opacity' with no opaque background.
This should be OK.

--HG--
extra : rebase_source : fa23d4980710a3961f23cedf3ebdf01b49d63518
Bug 1022612. Part 15: Add nsDisplayItem::GetVisibleRectForChildren(). r=mattwoodrow

--HG--
extra : rebase_source : cf958f41493ab25762f0c3bcc0361b0810e88549
Bug 1022612. Part 15.5: Use GetVisibleRectForChildren instead of GetVisibleRect. r=mattwoodrow

--HG--
extra : rebase_source : 4d90594855dbd4d8ff39d05c19703187004d9544
Bug 1022612. Part 16: No need to exclude final transparent region from window opaque region. r=mattwoodrow

The removed code should be a no-op as long as the window opaque region is
accurate enough.

--HG--
extra : rebase_source : 7486f406da1f01ca13bb903c2a171e68da8aa6ab
Bug 1022612. Part 17: RecordFrameMetrics should not set layer visible regions. r=mattwoodrow

This is unnecessary. FrameLayerBuilder sets the correct region.

--HG--
extra : rebase_source : 4fdef8f272870667a73575685e04644dca9473f3
Bug 1022612. Part 18: When ComputeVisibility returns false, RecomputeVisibility should avoid painting the item. r=mattwoodrow

--HG--
extra : rebase_source : 5f4fcb05204262bf6fea0c9df00137ab7e26bb00
Bug 1022612. Part 19: Test that merged display item lists merge their contents in the correct z-order. r=mattwoodrow

Prior to this patch, the only tests that caught this were a couple of obscure
cases on B2G. This test tests it on all platforms.

--HG--
extra : rebase_source : b4bb464bab59dd1d8c5e6b8aa4402d040105b27d