layout/forms/nsColorControlFrame.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 nsColorControlFrame_h___
michael@0 7 #define nsColorControlFrame_h___
michael@0 8
michael@0 9 #include "nsCOMPtr.h"
michael@0 10 #include "nsHTMLButtonControlFrame.h"
michael@0 11 #include "nsIAnonymousContentCreator.h"
michael@0 12
michael@0 13 typedef nsHTMLButtonControlFrame nsColorControlFrameSuper;
michael@0 14
michael@0 15 // Class which implements the input type=color
michael@0 16
michael@0 17 class nsColorControlFrame MOZ_FINAL : public nsColorControlFrameSuper,
michael@0 18 public nsIAnonymousContentCreator
michael@0 19 {
michael@0 20 typedef mozilla::dom::Element Element;
michael@0 21
michael@0 22 public:
michael@0 23 friend nsIFrame* NS_NewColorControlFrame(nsIPresShell* aPresShell,
michael@0 24 nsStyleContext* aContext);
michael@0 25
michael@0 26 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
michael@0 27
michael@0 28 NS_DECL_QUERYFRAME_TARGET(nsColorControlFrame)
michael@0 29 NS_DECL_QUERYFRAME
michael@0 30 NS_DECL_FRAMEARENA_HELPERS
michael@0 31
michael@0 32 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
michael@0 33
michael@0 34 #ifdef DEBUG_FRAME_DUMP
michael@0 35 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
michael@0 36 #endif
michael@0 37
michael@0 38 // nsIAnonymousContentCreator
michael@0 39 virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
michael@0 40 virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
michael@0 41 uint32_t aFilter) MOZ_OVERRIDE;
michael@0 42
michael@0 43 // nsIFrame
michael@0 44 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
michael@0 45 nsIAtom* aAttribute,
michael@0 46 int32_t aModType) MOZ_OVERRIDE;
michael@0 47 virtual bool IsLeaf() const MOZ_OVERRIDE { return true; }
michael@0 48 virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
michael@0 49
michael@0 50 virtual Element* GetPseudoElement(nsCSSPseudoElements::Type aType) MOZ_OVERRIDE;
michael@0 51
michael@0 52 // Refresh the color swatch, using associated input's value
michael@0 53 nsresult UpdateColor();
michael@0 54
michael@0 55 private:
michael@0 56 nsColorControlFrame(nsStyleContext* aContext);
michael@0 57
michael@0 58 nsCOMPtr<Element> mColorContent;
michael@0 59 };
michael@0 60
michael@0 61
michael@0 62 #endif // nsColorControlFrame_h___

mercurial