When SelectionCarets::Terminate() is called, it's not guaranteed that we
can get nsDocShell from PresContext. It causes that SelectionCarets
cannot remove itself as an observer.
To fix this, we keep a member WeakPtr<nsDocShell> so that we can always
have nsDocShell in SelectionCarets::Terminate().
This makes APZ behave nicely with most uses of a css transform:scale.
Summary of changes:
- FrameMetrics::mCumulativeResolution now includes the css-driven resolution
in addition to the pres-shell resolution.
- Displayports are now stored in Screen pixels rather than Layer pixels.
This is what we want anyways (as we'd like the displayport size to remain
constant as a fraction of the screen size), but it was necessary to make
this change as part of this patch because continuing to store them in
Layer pixels in the presence of a css-driven resolution would have
required a bunch of infrastructure to implement correctly.
Remaining work:
- Layout painting a scrollable layer at a resolution different from the
scale induced by the css transform causes problems. These will go away
with bug 1076192.
- Different resolutions on the x and y axes are not supported. This is
tracked by bug 1039967.
Until we get rid of animation phases in bug 960465, we need to ensure
we're producing style data for the correct animation phase. This makes
this optimization slightly less beneficial until then.
This makes APZ behave nicely with most uses of a css transform:scale.
Summary of changes:
- FrameMetrics::mCumulativeResolution now includes the css-driven resolution
in addition to the pres-shell resolution.
- Displayports are now stored in Screen pixels rather than Layer pixels.
This is what we want anyways (as we'd like the displayport size to remain
constant as a fraction of the screen size), but it was necessary to make
this change as part of this patch because continuing to store them in
Layer pixels in the presence of a css-driven resolution would have
required a bunch of infrastructure to implement correctly.
Remaining work:
- Layout painting a scrollable layer at a resolution different from the
scale induced by the css transform causes problems. These will go away
with bug 1076192.
- Different resolutions on the x and y axes are not supported. This is
tracked by bug 1039967.
By not excluding opaque borders from the display item cliprects, we produce
a larger opaque area for opaque background items.
--HG--
extra : rebase_source : 4e27157c2b60d1a0386a4db681dd8f1e741b61fd
LaunchLongTapDetector() is used to fire long tap to select word when
async pan zoom is not enabled. We should check if async pan zoom is
enabled rather than check whether it's on main process.
This can also fix selection carets not working on e10s.
When walking up the content tree to assess if an element is contained inside a
clickable element, we should stop before hitting the body element. This is a
heuristic based on pages in the wild, because a lot of pages have mouse/touch
listeners on the body. Without this patch all elements end up getting treated
as clickable which makes the event retargeting code useless.
Let SelectionCarets inherits from nsIReflowObserver so it could refresh
its position after reflow. This fixes the incorrect position of
selection carets after we rotate the device to change the screen from
portrait mode to landscape mode and vice versa.