tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsLeafFrame.cpp (1566B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 /* base class for rendering objects that do not have child lists */
      8 
      9 #include "nsLeafFrame.h"
     10 
     11 #include "mozilla/PresShell.h"
     12 #include "nsPresContext.h"
     13 
     14 using namespace mozilla;
     15 
     16 nsLeafFrame::~nsLeafFrame() = default;
     17 
     18 /* virtual */
     19 void nsLeafFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
     20                                   const nsDisplayListSet& aLists) {
     21  DO_GLOBAL_REFLOW_COUNT_DSP("nsLeafFrame");
     22  DisplayBorderBackgroundOutline(aBuilder, aLists);
     23 }
     24 
     25 nscoord nsLeafFrame::IntrinsicISize(const IntrinsicSizeInput& aInput,
     26                                    IntrinsicISizeType aType) {
     27  return GetIntrinsicSize().ISize(GetWritingMode()).valueOr(0);
     28 }
     29 
     30 /* virtual */
     31 LogicalSize nsLeafFrame::ComputeAutoSize(
     32    const SizeComputationInput& aSizingInput, WritingMode aWM,
     33    const LogicalSize& aCBSize, nscoord aAvailableISize,
     34    const LogicalSize& aMargin, const LogicalSize& aBorderPadding,
     35    const StyleSizeOverrides& aSizeOverrides, ComputeSizeFlags aFlags) {
     36  const WritingMode wm = GetWritingMode();
     37  IntrinsicSize intrinsicSize = GetIntrinsicSize();
     38  LogicalSize result(wm, intrinsicSize.ISize(wm).valueOr(0),
     39                     intrinsicSize.BSize(wm).valueOr(0));
     40  return result.ConvertTo(aWM, wm);
     41 }