layout/mathml/nsMathMLmoFrame.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsMathMLmoFrame_h___
     7 #define nsMathMLmoFrame_h___
     9 #include "mozilla/Attributes.h"
    10 #include "nsMathMLTokenFrame.h"
    11 #include "nsMathMLChar.h"
    13 //
    14 // <mo> -- operator, fence, or separator
    15 //
    17 class nsMathMLmoFrame : public nsMathMLTokenFrame {
    18 public:
    19   NS_DECL_FRAMEARENA_HELPERS
    21   friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    23   virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE;
    25   virtual void
    26   SetAdditionalStyleContext(int32_t          aIndex, 
    27                             nsStyleContext*  aStyleContext) MOZ_OVERRIDE;
    28   virtual nsStyleContext*
    29   GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
    31   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    32                                 const nsRect&           aDirtyRect,
    33                                 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    35   NS_IMETHOD
    36   InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
    38   NS_IMETHOD
    39   TransmitAutomaticData() MOZ_OVERRIDE;
    41   virtual nsresult
    42   SetInitialChildList(ChildListID     aListID,
    43                       nsFrameList&    aChildList) MOZ_OVERRIDE;
    45   virtual nsresult
    46   Reflow(nsPresContext*          aPresContext,
    47          nsHTMLReflowMetrics&     aDesiredSize,
    48          const nsHTMLReflowState& aReflowState,
    49          nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    51   virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
    53   virtual void
    54   GetIntrinsicWidthMetrics(nsRenderingContext* aRenderingContext,
    55                            nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
    57   virtual nsresult
    58   AttributeChanged(int32_t         aNameSpaceID,
    59                    nsIAtom*        aAttribute,
    60                    int32_t         aModType) MOZ_OVERRIDE;
    62   // This method is called by the parent frame to ask <mo> 
    63   // to stretch itself.
    64   NS_IMETHOD
    65   Stretch(nsRenderingContext& aRenderingContext,
    66           nsStretchDirection   aStretchDirection,
    67           nsBoundingMetrics&   aContainerSize,
    68           nsHTMLReflowMetrics& aDesiredStretchSize) MOZ_OVERRIDE;
    70   virtual nsresult
    71   ChildListChanged(int32_t aModType) MOZ_OVERRIDE
    72   {
    73     ProcessTextData();
    74     return nsMathMLContainerFrame::ChildListChanged(aModType);
    75   }
    77 protected:
    78   nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {}
    79   virtual ~nsMathMLmoFrame();
    81   nsMathMLChar     mMathMLChar; // Here is the MathMLChar that will deal with the operator.
    82   nsOperatorFlags  mFlags;
    83   float            mMinSize;
    84   float            mMaxSize;
    86   bool UseMathMLChar();
    88   // overload the base method so that we can setup our nsMathMLChar
    89   void ProcessTextData();
    91   // helper to get our 'form' and lookup in the Operator Dictionary to fetch 
    92   // our default data that may come from there, and to complete the setup
    93   // using attributes that we may have
    94   void
    95   ProcessOperatorData();
    97   // helper to double check thar our char should be rendered as a selected char
    98   bool
    99   IsFrameInSelection(nsIFrame* aFrame);
   100 };
   102 #endif /* nsMathMLmoFrame_h___ */

mercurial