accessible/src/html/HTMLListAccessible.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 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_a11y_HTMLListAccessible_h__
michael@0 8 #define mozilla_a11y_HTMLListAccessible_h__
michael@0 9
michael@0 10 #include "BaseAccessibles.h"
michael@0 11 #include "HyperTextAccessibleWrap.h"
michael@0 12
michael@0 13 namespace mozilla {
michael@0 14 namespace a11y {
michael@0 15
michael@0 16 class HTMLListBulletAccessible;
michael@0 17
michael@0 18 /**
michael@0 19 * Used for HTML list (like HTML ul).
michael@0 20 */
michael@0 21 class HTMLListAccessible : public HyperTextAccessibleWrap
michael@0 22 {
michael@0 23 public:
michael@0 24 HTMLListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
michael@0 25 HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; }
michael@0 26 virtual ~HTMLListAccessible() { }
michael@0 27
michael@0 28 // nsISupports
michael@0 29 NS_DECL_ISUPPORTS_INHERITED
michael@0 30
michael@0 31 // Accessible
michael@0 32 virtual a11y::role NativeRole();
michael@0 33 virtual uint64_t NativeState();
michael@0 34 };
michael@0 35
michael@0 36
michael@0 37 /**
michael@0 38 * Used for HTML list item (e.g. HTML li).
michael@0 39 */
michael@0 40 class HTMLLIAccessible : public HyperTextAccessibleWrap
michael@0 41 {
michael@0 42 public:
michael@0 43 HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc);
michael@0 44 virtual ~HTMLLIAccessible() { }
michael@0 45
michael@0 46 // nsISupports
michael@0 47 NS_DECL_ISUPPORTS_INHERITED
michael@0 48
michael@0 49 // nsIAccessible
michael@0 50 NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
michael@0 51 int32_t* aWidth, int32_t* aHeight);
michael@0 52
michael@0 53 // Accessible
michael@0 54 virtual void Shutdown();
michael@0 55 virtual a11y::role NativeRole();
michael@0 56 virtual uint64_t NativeState();
michael@0 57
michael@0 58 // HTMLLIAccessible
michael@0 59 HTMLListBulletAccessible* Bullet() const { return mBullet; }
michael@0 60 void UpdateBullet(bool aHasBullet);
michael@0 61
michael@0 62 protected:
michael@0 63 // Accessible
michael@0 64 virtual void CacheChildren();
michael@0 65
michael@0 66 private:
michael@0 67 nsRefPtr<HTMLListBulletAccessible> mBullet;
michael@0 68 };
michael@0 69
michael@0 70
michael@0 71 /**
michael@0 72 * Used for bullet of HTML list item element (for example, HTML li).
michael@0 73 */
michael@0 74 class HTMLListBulletAccessible : public LeafAccessible
michael@0 75 {
michael@0 76 public:
michael@0 77 HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
michael@0 78 virtual ~HTMLListBulletAccessible() { }
michael@0 79
michael@0 80 // Accessible
michael@0 81 virtual nsIFrame* GetFrame() const;
michael@0 82 virtual ENameValueFlag Name(nsString& aName);
michael@0 83 virtual a11y::role NativeRole();
michael@0 84 virtual uint64_t NativeState();
michael@0 85 virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
michael@0 86 uint32_t aLength = UINT32_MAX);
michael@0 87
michael@0 88 // HTMLListBulletAccessible
michael@0 89
michael@0 90 /**
michael@0 91 * Return true if the bullet is inside of list item element boundaries.
michael@0 92 */
michael@0 93 bool IsInside() const;
michael@0 94 };
michael@0 95
michael@0 96
michael@0 97 inline HTMLLIAccessible*
michael@0 98 Accessible::AsHTMLListItem()
michael@0 99 {
michael@0 100 return IsHTMLListItem() ? static_cast<HTMLLIAccessible*>(this) : nullptr;
michael@0 101 }
michael@0 102
michael@0 103 } // namespace a11y
michael@0 104 } // namespace mozilla
michael@0 105
michael@0 106 #endif

mercurial