layout/mathml/nsMathMLmpaddedFrame.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsMathMLmpaddedFrame_h___
michael@0 7 #define nsMathMLmpaddedFrame_h___
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "nsMathMLContainerFrame.h"
michael@0 11
michael@0 12 //
michael@0 13 // <mpadded> -- adjust space around content
michael@0 14 //
michael@0 15
michael@0 16 class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
michael@0 17 public:
michael@0 18 NS_DECL_FRAMEARENA_HELPERS
michael@0 19
michael@0 20 friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 21
michael@0 22 NS_IMETHOD
michael@0 23 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
michael@0 24
michael@0 25 NS_IMETHOD
michael@0 26 TransmitAutomaticData() MOZ_OVERRIDE {
michael@0 27 return TransmitAutomaticDataForMrowLikeElement();
michael@0 28 }
michael@0 29
michael@0 30 virtual nsresult
michael@0 31 Reflow(nsPresContext* aPresContext,
michael@0 32 nsHTMLReflowMetrics& aDesiredSize,
michael@0 33 const nsHTMLReflowState& aReflowState,
michael@0 34 nsReflowStatus& aStatus) MOZ_OVERRIDE;
michael@0 35
michael@0 36 virtual nsresult
michael@0 37 Place(nsRenderingContext& aRenderingContext,
michael@0 38 bool aPlaceOrigin,
michael@0 39 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
michael@0 40
michael@0 41 bool
michael@0 42 IsMrowLike() MOZ_OVERRIDE {
michael@0 43 return mFrames.FirstChild() != mFrames.LastChild() ||
michael@0 44 !mFrames.FirstChild();
michael@0 45 }
michael@0 46
michael@0 47 protected:
michael@0 48 nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
michael@0 49 virtual ~nsMathMLmpaddedFrame();
michael@0 50
michael@0 51 virtual nsresult
michael@0 52 MeasureForWidth(nsRenderingContext& aRenderingContext,
michael@0 53 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
michael@0 54
michael@0 55 private:
michael@0 56 nsCSSValue mWidth;
michael@0 57 nsCSSValue mHeight;
michael@0 58 nsCSSValue mDepth;
michael@0 59 nsCSSValue mLeadingSpace;
michael@0 60 nsCSSValue mVerticalOffset;
michael@0 61
michael@0 62 int32_t mWidthSign;
michael@0 63 int32_t mHeightSign;
michael@0 64 int32_t mDepthSign;
michael@0 65 int32_t mLeadingSpaceSign;
michael@0 66 int32_t mVerticalOffsetSign;
michael@0 67
michael@0 68 int32_t mWidthPseudoUnit;
michael@0 69 int32_t mHeightPseudoUnit;
michael@0 70 int32_t mDepthPseudoUnit;
michael@0 71 int32_t mLeadingSpacePseudoUnit;
michael@0 72 int32_t mVerticalOffsetPseudoUnit;
michael@0 73
michael@0 74 // helpers to process the attributes
michael@0 75 void
michael@0 76 ProcessAttributes();
michael@0 77
michael@0 78 static bool
michael@0 79 ParseAttribute(nsString& aString,
michael@0 80 int32_t& aSign,
michael@0 81 nsCSSValue& aCSSValue,
michael@0 82 int32_t& aPseudoUnit);
michael@0 83
michael@0 84 void
michael@0 85 UpdateValue(int32_t aSign,
michael@0 86 int32_t aPseudoUnit,
michael@0 87 const nsCSSValue& aCSSValue,
michael@0 88 const nsHTMLReflowMetrics& aDesiredSize,
michael@0 89 nscoord& aValueToUpdate) const;
michael@0 90 };
michael@0 91
michael@0 92 #endif /* nsMathMLmpaddedFrame_h___ */

mercurial