89 Commits

Author SHA1 Message Date
Ojan Vafai
ef1b30faf7 Move FilterEffectRenderer out of RenderLayer into RenderBox.
It doesn't do anything RenderLayer specific anymore. This
does mean adding another pointer to RenderBox. We might want
to do something about that eventually, but for now it seems fine
to make forward progress in terms of getting rid of the RenderLayer
tree.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/963253002
2015-02-27 13:42:29 -08:00
Ojan Vafai
4b60c28783 Simplify RenderLayer's handling of filters.
-Remove RenderLayerFilterInfo. It was just a static map for
FilterEffectRenderers. Instead, put the FilterEffectRenderer
directly on RenderLayer.
-Make FilterEffectRenderer not be RefCounted. This involved
deleting a ton of dead code around ReferenceFilters since they
were the other subclass of Filter. As best I can tell,
reference filters are already don't parse in Sky, so this should
just be removing dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/962543003
2015-02-26 15:38:14 -08:00
Ojan Vafai
f36e7b49db Assorted cleanup of RenderLayer.
-Move perspectiveOrigin to RenderBox. It's only used in
one place and called on a RenderBox.
-Inline some methods that were just calling out to the renderer.
-Inline updateStackingNode() into the constructor and remove
the branch since requiresStackingNode is always true.
-Delete a bunch of dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961053002
2015-02-26 13:07:20 -08:00
Ojan Vafai
ba092f1cd5 Remove dead code from RenderLayer and inline filter methods.
Inline a couple methods that are only called from one place
and remove a bunch of dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961553003
2015-02-26 11:04:53 -08:00
Ojan Vafai
cec128f499 Remove some dead RenderLayer code.
-m_hasSelfPaintingLayerDescendant is never read.
-remove showLayerTree. The layer tree is going away. We won't need this.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/952343003
2015-02-25 15:48:59 -08:00
Ojan Vafai
78691e3c21 Inline RenderLayer::beginTransparencyLayers into RenderBox::paintLayerContents.
This is the only remaining caller.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/954913002
2015-02-24 20:59:01 -08:00
Ojan Vafai
82ab56a89b Remove some dead filters related code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/943333005
2015-02-24 20:45:53 -08:00
Ojan Vafai
0be786f62c Simplify and reduce calls to beginTransparencyLayers.
-Consolidate the beginTransparencyLayers calls. The call
on layer()->parent() was just not needed as best I can tell
and the filter one could just be shared with the non-filter
codepath. FWIW, blink has already made a similar set of changes.
-Don't walk up the tree calling beginTransparencyLayer.
We're doing this in a recursive call down, so we've already
created the transparency layer for any transparent ancestors.
-Remove unused TransparencyClipBoxMode argument.
-Inline the paintingExtent method.
-Removed unused REVEAL_TRANSPARENCY_LAYERS #define.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/959543002
2015-02-24 17:29:00 -08:00
Ojan Vafai
c885cea0f7 Cleanup transform-related methods in RenderLayer.
-Get rid of paintsWithTransform.
-Remove currentTransform. It was only ever called with
IncludeTransformOrigin and on non-null transforms.
-Remove renderableTransform. It was only called on
non-null transforms.
-Remove a layer()->parent() branch. The ASSERT had been
added in a previous patch, but the branch wasn't removed.
-Inline makeMatrixRenderable. It was only called in one
place.
-Add a test to make sure that transform origin is corrrectly
excluded from the transform computedStyle.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/958463002
2015-02-24 14:31:48 -08:00
Ojan Vafai
920920310e Delete RenderLayerModelObject.
Merge most of it into RenderBox. Only RenderBoxes can have
layers now. This also meant a bit of code could be cleaned up
since some virtuals (e.g. updateFromStyle) are no longer needed
since they're only called on RenderBoxes.

collectSelfPaintingLayers is the only bit that's moved into
RenderBoxModelObject instead of RenderBox. That's because we
need to be able to recurse down into RenderInlines since they
may contain RenderBoxes that have selfPaintingLayers.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/953673002
2015-02-23 17:24:38 -08:00
Ojan Vafai
a267c39c01 Remove the concept of staticly positioned absolutes.
On the web, if you set position:absolute, but not
top/right/bottom/left, then the absolute goes where it
would have gone if it wasn't positioned. The use-cases for
this are slim and it introduces a lot of complexity to the
engine.

Also changes behavior in the presence of direction:rtl.
On the web, direction:rtl and top/left:auto would
sometimes set right:0. Instead we always position at
0,0 if the opposing values are auto.

This removes the code for this positioning and allows
simplifying a bunch of dirty bit handling code since
we don't need to setNeedsLayout if lines move around
or wrap differently.

The test cases did change their output, but the new
positioning all looks correct to me.

Review URL: https://codereview.chromium.org/944073006
2015-02-20 20:26:59 -08:00
Ojan Vafai
a42e249b69 Remove dead position:relative code.
There are some cases in this patch where it's not
obvious that the code only applies to position:relative,
but the code asserts that it does. In those cases,
I trusted the asserts and deleted the code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/938193004
2015-02-20 11:37:17 -08:00
Ojan Vafai
74290d5007 Move hit testing out of RenderLayer into RenderBox.
Change hit testing to walk over the render tree instead of
the RenderLayer tree. This is a step in the direction of
removing the RenderLayer tree entirely.

For now, there's a few calls back into RenderLayer that
will be removed in a followup patch. This patch also
breaks hit testing on transformed inlines. I'll be
removing the ability to transform inlines in a
followup patch anyways, so it's ok for hit testing
to give the wrong result temporarily here.

Almost all of this patch is just moving code from
RenderLayer to RenderBox. The primary substantive change
is in RenderBox::hitTestLayer. Instead of having
hitTestChildren calls, we call collectSelfPaintingLayers,
reverse sort by z-index (so we start at the top),
and then iterate over the result.

The test-case also exposes that we don't correctly hit
transformed elements inside inline-blocks. I went back as
far as 4153b8a515d54275934d4244aaf2d5a7a8fe3333 and the
bug still happened.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945693002
2015-02-19 21:31:42 -08:00
Ojan Vafai
3edb147679 Change the return value of RenderLayer::hitTestLayer.
All the code only cares about whether we hit, not
which layer we hit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939793003
2015-02-18 19:52:16 -08:00
Ojan Vafai
bd8d560b7a Merge RenderLayer::hitTest into RenderView::hitTest.
Only RenderView calls this method. The actual tree walk
happens in RenderLayer::hitTestLayer, which a followup
patch will move into RenderBox.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939483005
2015-02-18 19:29:30 -08:00
Ojan Vafai
6b07257fb6 Merge hitTestLayerByApplyingTransform into hitTestLayer.
This makes hitTestLayer a bit larger at the benefit of making
the code a bit easier to follow and getting rid of the confusing
recursive call to hitTestLayer and the appliedTransform bool.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/937023002
2015-02-18 18:40:20 -08:00
Ojan Vafai
f9ddb1cabd Increase code coverage for RenderLayer::hitTestLayer.
Add tests for the NormalFlowChildren and transforms code paths.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/926823004
2015-02-18 16:07:35 -08:00
Adam Barth
dff66fb1b7 Remove the concept of document.documentElement
Now documents can have many element children, all created equal.

R=esprehn@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/928393003
2015-02-17 16:20:07 -08:00
Ojan Vafai
04f9707e4f Remove HitTestFilter.
Background and foreground on a layer can't be hit indepdently
anymore, so merge them into a single hitTestContents call.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924273002
2015-02-13 21:07:54 -08:00
Ojan Vafai
e0c039e035 Get rid of HitTestChildBlockBackground walk.
I'm not 100% what this was for, but looking at Blink,
it appears that HitTestChildBlockBackground being different
from HitTestBlockBackground had something to do with
multi-column/regions, which we don't have. I believe
this patch doesn't change any behavior.

Also added to the elementFromPoint test in order to
get more test coverage of the hitTesting code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924263002
2015-02-13 21:05:58 -08:00
Ojan Vafai
5e291c32e2 Prune HitTestResult and stop special-casing links.
Prunes a bunch of dead code from HitTestResult and
stops special-casing links for creating hand cursors.
This code already isn't working today anyways, so
in practice, there's no change in behavior.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/925933004
2015-02-13 14:17:42 -08:00
Ojan Vafai
1d3f70fc06 Remove unnecessary operator overload on RenderLayer::hitTest.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/925903005
2015-02-13 14:12:38 -08:00
Ojan Vafai
6ee8440f27 Walk render tree instead of render layers for paint.
This is the first step of getting rid of RenderLayer.
Instead of walking the RenderLayer tree, wall the RenderObject
tree and add any layers encountered to a vector to paint later.

This patch just consolidates and move the code from RenderLayer
to RenderBox and then changes the children painting to
iterate over the vector. Therefore we walk the RenderObject tree.
We still call out to RenderLayer in a bunch of places.
A followup patch will get rid of those.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/899753003
2015-02-06 11:38:25 +11:00
Ojan Vafai
b139ec4316 Delete remaining masks dead code.
Removes the straggling code related to masks now that
we've removed the CSS properties.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/893093002
2015-02-03 13:56:34 +11:00
Ojan Vafai
b264b3c269 Remove the last remnant of paint phases.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/895483002
2015-02-01 21:09:10 -08:00
Ojan Vafai
bd590c7b05 Remove mask painting.
Now that we don't have -webkit-mask-*, this is dead code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886263003
2015-02-01 20:37:32 -08:00
Ojan Vafai
194360db4f Inline two methods with only one caller.
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886923003
2015-01-29 21:02:16 -08:00
Ojan Vafai
030073714c Removed a bunch of unneeded paint phase checks.
We only have two paint phases now, so we don't
need to do as many checks. Also, remove some
early returns that are not possible to hit since
the earlier code checks that phase already.

R=abarth@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/891573002
2015-01-29 18:57:06 -08:00
Ojan Vafai
bdc24bf049 Remove painting roots.
These appear to have been for ensuring that you
only paint elements in a given subtree. It's not clear
to me exactly how you get to painting an element that
is not rooted at the RenderLayer you started with.
I think it's just not possible in Sky anymore.
This code was added in 2004 for drag images, which
we no longer support.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/882223005
2015-01-28 19:53:44 -08:00
Ojan Vafai
b4c4004f56 Merge outline paint phases into the foreground phase.
Mostly just mechanical changes. The one surprising bit
is that RenderLayer no longer needs to explictly paint
outlines. I tested manually that before this patch,
the paintOutline call in RenderLayer was needed for
outlines on positioned elements and that after this
patch it's not.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878023002
2015-01-27 17:45:04 -08:00
Adam Barth
f4618c1bb2 Remove RenderLayer::m_lostGroupedMapping
No one touches this state.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881123002
2015-01-27 15:21:24 -08:00
Adam Barth
54809a8877 Remove more scrolling code from Sky
None of this code does anything anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878303002
2015-01-27 15:20:14 -08:00
Adam Barth
645a6a9d12 Remove dead code related to compositing from Sky
R=esprehn@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/865153004
2015-01-27 14:38:56 -08:00
Adam Barth
c33c565f8b Remove ScrollableArea and Scrollbar
This code is unused.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879993004
2015-01-27 12:08:24 -08:00
Adam Barth
4e74d9df30 Remove RenderLayerScrollableArea
This CL is a first step towards removing the scrolling machinery from the
engine. Notice that we pay a tax for scrolling in RenderBlockFlow::layout.

R=esprehn@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/877043002
2015-01-27 09:58:45 -08:00
Ojan Vafai
d3ea308c89 Fix border painting on self-painting layers.
Commit efc3afd428bd85fd3d12e0dc941b5eb7248ca30b broke it because
we'd computed an empty foreground layer. Now that background
painting is part of the foreground phase, we need to use the
background rect for clipping. As best I can tell, the
background rect is always >= the size of the foreground
rect, so it should be safe to use.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/876243002
2015-01-26 22:45:30 -08:00
Ojan Vafai
785f64ed86 Remove outline painting on inlines.
Jagged edge outlines are more complexity than is justified
for the use-cases. We should enable to use-cases like this,
but with a lower-level line-box + custom painting API.

Removes the paintOutline method on RenderInline. Also removed
a number of dead methods that call absoluteRects so we can delete
that method and related code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867653005
2015-01-26 18:58:02 -08:00
Ojan Vafai
b854dc1ebf Remove negative z-index.
There's no good use-case for putting descendants behind
their ancestors.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/873983007
2015-01-26 18:55:09 -08:00
Ojan Vafai
81341480bf Merge the background paint phase into the foreground phase.
First step in getting rid of paint phases. Verified that
deleting this phase entirely would cause flights-app-pixel.sky
to fail and that it still passes in this patch, which just does
the background painting as part of the foreground phase.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867463005
2015-01-26 15:52:47 -08:00
Adam Barth
385cd6107c Remove unused hit testing modes in Sky
R=eseidel@google.com

Review URL: https://codereview.chromium.org/855223002
2015-01-19 19:11:20 -08:00
Ojan Vafai
4256d4a224 Remove background obscuration checks.
This is an optimization to avoid painting backgrounds
that are obscured. It's a lot of complexity that it's
not clear we'll need given that we're using a GL backend.
Also, we can add it back in more easily/efficiently in the future
once we have a display list architecture.

This also means we can remove the needsPaintInvalidation
dirty bit and some opacity information on filters.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/856563006
2015-01-15 17:11:44 -08:00
Adam Barth
c312fcbaa4 Trace RenderLayer::paint
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/851473005
2015-01-15 15:18:02 -08:00
Ojan Vafai
eb68343228 Remove deferredfiltersenabled settings.
I have no idea what this setting does, but I just mechanically
removed it since it's always set to true.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/848243002
2015-01-14 18:58:27 -08:00
Ojan Vafai
8e3f746bad Remove assorted dead paint invalidation code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/850763008
2015-01-14 13:46:39 -08:00
Ojan Vafai
3e26389e5d Delete PaintInvalidationState. It's unused.
Delete selection paint invalidation code.

There is a slight change in behavior in FrameSelection::revealSelection.
If you have a non-collapsed selection, then we'll center the start
of the selection instead of the whole selection in some cases. There's
a ton of callers of this code, so it's hard to be sure if any of this
actually changes behavior for sky. In manual testing, I couldn't find
any scenarios where there was a difference. Almost universally,
when we call revealSelection, we have a CaretSelection. The only
case I could think of where we have a RangeSelection is when
modifying an off-screen selection (e.g. shift+right), but in that case
we pass the RevealExtent option, so this patch doesn't change behavior
there.

Removing that caller makes all the rest of this rect computing
code into dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/823123003
2015-01-14 13:25:49 -08:00
Ojan Vafai
5f718d3e63 Delete selection paint invalidation code.
There is a slight change in behavior in FrameSelection::revealSelection.
If you have a non-collapsed selection, then we'll center the start
of the selection instead of the whole selection in some cases. There's
a ton of callers of this code, so it's hard to be sure if any of this
actually changes behavior for sky. In manual testing, I couldn't find
any scenarios where there was a difference. Almost universally,
when we call revealSelection, we have a CaretSelection. The only
case I could think of where we have a RangeSelection is when
modifying an off-screen selection (e.g. shift+right), but in that case
we pass the RevealExtent option, so this patch doesn't change behavior
there.

Removing that caller makes all the rest of this rect computing
code into dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/847303003
2015-01-14 13:25:16 -08:00
Ojan Vafai
1729b054e2 Delete dead painting code around m_pendingSheetLayout.
m_pendingSheetLayout is never set to a non-default value.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/837633003
2015-01-12 17:15:26 -08:00
Ojan Vafai
544a24a448 Delete RenderSelectionInfo and other selection rect paint invalidation code.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/851593002
2015-01-12 17:08:36 -08:00
Ojan Vafai
a198a95ea6 Delete invalidateTreeIfNeeded.
This is just setting and clearing paint invalidation dirty bits.
Also remove a bunch of the paint invalidation dirty bits entirely.
There's plenty more to do.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/791023006
2015-01-12 13:29:12 -08:00
Ojan Vafai
cfbabf0397 Delete a bunch of paint invalidation rect computing code.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/845873004
2015-01-09 19:05:59 -08:00