style: Factor dynamic toolbar max height into layout metrics.

Now
* nsPresContext::mVisibleArea is excluding the toolbar max height so that
  ICB is now static regardless of the dynamic toolbar transition
* nsPresContext::mSizeForViewportUnits is introduced to resolve viewport units
  which is including the toolbar max height

That means that with the dynamic toolbar max height;

  mVisibleArea < mSizeForViewportUnits

See https://github.com/bokand/URLBarSizing for more detail backgrounds of this
change.

Depends on D50417

Differential Revision: https://phabricator.services.mozilla.com/D50418
This commit is contained in:
Hiroyuki Ikezoe 2019-11-14 06:00:05 +00:00 committed by Emilio Cobos Álvarez
parent ff1a9dbb2e
commit 7fec79ffcf
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -237,7 +237,13 @@ impl Device {
/// used for viewport unit resolution. /// used for viewport unit resolution.
pub fn au_viewport_size_for_viewport_unit_resolution(&self) -> Size2D<Au> { pub fn au_viewport_size_for_viewport_unit_resolution(&self) -> Size2D<Au> {
self.used_viewport_size.store(true, Ordering::Relaxed); self.used_viewport_size.store(true, Ordering::Relaxed);
self.au_viewport_size()
let pc = match self.pres_context() {
Some(pc) => pc,
None => return Size2D::new(Au(0), Au(0)),
};
let size = &pc.mSizeForViewportUnits;
Size2D::new(Au(size.width), Au(size.height))
} }
/// Returns whether we ever looked up the viewport size of the Device. /// Returns whether we ever looked up the viewport size of the Device.