parser/html/nsHtml5StateSnapshot.cpp

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 /*
michael@0 2 * Copyright (c) 2009-2010 Mozilla Foundation
michael@0 3 *
michael@0 4 * Permission is hereby granted, free of charge, to any person obtaining a
michael@0 5 * copy of this software and associated documentation files (the "Software"),
michael@0 6 * to deal in the Software without restriction, including without limitation
michael@0 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
michael@0 8 * and/or sell copies of the Software, and to permit persons to whom the
michael@0 9 * Software is furnished to do so, subject to the following conditions:
michael@0 10 *
michael@0 11 * The above copyright notice and this permission notice shall be included in
michael@0 12 * all copies or substantial portions of the Software.
michael@0 13 *
michael@0 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
michael@0 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
michael@0 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
michael@0 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
michael@0 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
michael@0 19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
michael@0 20 * DEALINGS IN THE SOFTWARE.
michael@0 21 */
michael@0 22
michael@0 23 /*
michael@0 24 * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
michael@0 25 * Please edit StateSnapshot.java instead and regenerate.
michael@0 26 */
michael@0 27
michael@0 28 #define nsHtml5StateSnapshot_cpp__
michael@0 29
michael@0 30 #include "nsIAtom.h"
michael@0 31 #include "nsHtml5AtomTable.h"
michael@0 32 #include "nsString.h"
michael@0 33 #include "nsNameSpaceManager.h"
michael@0 34 #include "nsIContent.h"
michael@0 35 #include "nsTraceRefcnt.h"
michael@0 36 #include "jArray.h"
michael@0 37 #include "nsHtml5ArrayCopy.h"
michael@0 38 #include "nsAHtml5TreeBuilderState.h"
michael@0 39 #include "nsHtml5Atoms.h"
michael@0 40 #include "nsHtml5ByteReadable.h"
michael@0 41 #include "nsIUnicodeDecoder.h"
michael@0 42 #include "nsHtml5Macros.h"
michael@0 43 #include "nsIContentHandle.h"
michael@0 44
michael@0 45 #include "nsHtml5Tokenizer.h"
michael@0 46 #include "nsHtml5TreeBuilder.h"
michael@0 47 #include "nsHtml5MetaScanner.h"
michael@0 48 #include "nsHtml5AttributeName.h"
michael@0 49 #include "nsHtml5ElementName.h"
michael@0 50 #include "nsHtml5HtmlAttributes.h"
michael@0 51 #include "nsHtml5StackNode.h"
michael@0 52 #include "nsHtml5UTF16Buffer.h"
michael@0 53 #include "nsHtml5Portability.h"
michael@0 54
michael@0 55 #include "nsHtml5StateSnapshot.h"
michael@0 56
michael@0 57
michael@0 58 nsHtml5StateSnapshot::nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContentHandle* formPointer, nsIContentHandle* headPointer, nsIContentHandle* deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks)
michael@0 59 : stack(stack),
michael@0 60 listOfActiveFormattingElements(listOfActiveFormattingElements),
michael@0 61 templateModeStack(templateModeStack),
michael@0 62 formPointer(formPointer),
michael@0 63 headPointer(headPointer),
michael@0 64 deepTreeSurrogateParent(deepTreeSurrogateParent),
michael@0 65 mode(mode),
michael@0 66 originalMode(originalMode),
michael@0 67 framesetOk(framesetOk),
michael@0 68 needToDropLF(needToDropLF),
michael@0 69 quirks(quirks)
michael@0 70 {
michael@0 71 MOZ_COUNT_CTOR(nsHtml5StateSnapshot);
michael@0 72 }
michael@0 73
michael@0 74 jArray<nsHtml5StackNode*,int32_t>
michael@0 75 nsHtml5StateSnapshot::getStack()
michael@0 76 {
michael@0 77 return stack;
michael@0 78 }
michael@0 79
michael@0 80 jArray<int32_t,int32_t>
michael@0 81 nsHtml5StateSnapshot::getTemplateModeStack()
michael@0 82 {
michael@0 83 return templateModeStack;
michael@0 84 }
michael@0 85
michael@0 86 jArray<nsHtml5StackNode*,int32_t>
michael@0 87 nsHtml5StateSnapshot::getListOfActiveFormattingElements()
michael@0 88 {
michael@0 89 return listOfActiveFormattingElements;
michael@0 90 }
michael@0 91
michael@0 92 nsIContentHandle*
michael@0 93 nsHtml5StateSnapshot::getFormPointer()
michael@0 94 {
michael@0 95 return formPointer;
michael@0 96 }
michael@0 97
michael@0 98 nsIContentHandle*
michael@0 99 nsHtml5StateSnapshot::getHeadPointer()
michael@0 100 {
michael@0 101 return headPointer;
michael@0 102 }
michael@0 103
michael@0 104 nsIContentHandle*
michael@0 105 nsHtml5StateSnapshot::getDeepTreeSurrogateParent()
michael@0 106 {
michael@0 107 return deepTreeSurrogateParent;
michael@0 108 }
michael@0 109
michael@0 110 int32_t
michael@0 111 nsHtml5StateSnapshot::getMode()
michael@0 112 {
michael@0 113 return mode;
michael@0 114 }
michael@0 115
michael@0 116 int32_t
michael@0 117 nsHtml5StateSnapshot::getOriginalMode()
michael@0 118 {
michael@0 119 return originalMode;
michael@0 120 }
michael@0 121
michael@0 122 bool
michael@0 123 nsHtml5StateSnapshot::isFramesetOk()
michael@0 124 {
michael@0 125 return framesetOk;
michael@0 126 }
michael@0 127
michael@0 128 bool
michael@0 129 nsHtml5StateSnapshot::isNeedToDropLF()
michael@0 130 {
michael@0 131 return needToDropLF;
michael@0 132 }
michael@0 133
michael@0 134 bool
michael@0 135 nsHtml5StateSnapshot::isQuirks()
michael@0 136 {
michael@0 137 return quirks;
michael@0 138 }
michael@0 139
michael@0 140 int32_t
michael@0 141 nsHtml5StateSnapshot::getListOfActiveFormattingElementsLength()
michael@0 142 {
michael@0 143 return listOfActiveFormattingElements.length;
michael@0 144 }
michael@0 145
michael@0 146 int32_t
michael@0 147 nsHtml5StateSnapshot::getStackLength()
michael@0 148 {
michael@0 149 return stack.length;
michael@0 150 }
michael@0 151
michael@0 152 int32_t
michael@0 153 nsHtml5StateSnapshot::getTemplateModeStackLength()
michael@0 154 {
michael@0 155 return templateModeStack.length;
michael@0 156 }
michael@0 157
michael@0 158
michael@0 159 nsHtml5StateSnapshot::~nsHtml5StateSnapshot()
michael@0 160 {
michael@0 161 MOZ_COUNT_DTOR(nsHtml5StateSnapshot);
michael@0 162 for (int32_t i = 0; i < stack.length; i++) {
michael@0 163 stack[i]->release();
michael@0 164 }
michael@0 165 for (int32_t i = 0; i < listOfActiveFormattingElements.length; i++) {
michael@0 166 if (listOfActiveFormattingElements[i]) {
michael@0 167 listOfActiveFormattingElements[i]->release();
michael@0 168 }
michael@0 169 }
michael@0 170 }
michael@0 171
michael@0 172 void
michael@0 173 nsHtml5StateSnapshot::initializeStatics()
michael@0 174 {
michael@0 175 }
michael@0 176
michael@0 177 void
michael@0 178 nsHtml5StateSnapshot::releaseStatics()
michael@0 179 {
michael@0 180 }
michael@0 181
michael@0 182

mercurial