Skip to content

Commit

Permalink
Bug 256180 parser part - Insert elements as siblings instead of child…
Browse files Browse the repository at this point in the history
…ren at the Blink-defined magic depth for compatibility. r=smaug

MozReview-Commit-ID: K8fgv3rgklt

--HG--
extra : rebase_source : 3ad91a01805afcd1aeac89a5f2d5ac38dac1797b
  • Loading branch information
hsivonen committed Sep 12, 2017
1 parent ef3dabb commit b245e01
Show file tree
Hide file tree
Showing 19 changed files with 6,405 additions and 208 deletions.
1 change: 1 addition & 0 deletions dom/locales/en-US/chrome/layout/htmlparser.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ errNoSpaceBetweenPublicAndSystemIds=No space between the doctype public and syst
errNoSpaceBetweenDoctypePublicKeywordAndQuote=No space between the doctype “PUBLIC” keyword and the quote.

# Tree builder errors
errDeepTree=The document tree is too deep. The tree will be flattened to be 513 elements deep.
errStrayStartTag2=Stray start tag “%1$S”.
errStrayEndTag=Stray end tag “%1$S”.
errUnclosedElements=End tag “%1$S” seen, but there were open elements.
Expand Down
2,004 changes: 2,004 additions & 0 deletions layout/reftests/bugs/256180-5-ref.html

Large diffs are not rendered by default.

2,042 changes: 2,042 additions & 0 deletions layout/reftests/bugs/256180-5.html

Large diffs are not rendered by default.

2,004 changes: 2,004 additions & 0 deletions layout/reftests/bugs/256180-6-ref.html

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions layout/reftests/bugs/256180-6.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions layout/reftests/bugs/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ skip-if(isDebugBuild||Android||AddressSanitizer||(winWidget&&(!is64Bit))) == 256
# Debug builds have larger stack frames, so skipped.
# Making Android on aarch64 not crash is bug 1400811.
skip-if(isDebugBuild||(Android&&is64Bit)) == 256180-4.html 256180-4-ref.html
skip-if(isDebugBuild||(Android&&is64Bit)) == 256180-5.html 256180-5-ref.html
skip-if(isDebugBuild||(Android&&is64Bit)) == 256180-6.html 256180-6-ref.html
== 25888-1l.html 25888-1l-ref.html
!= 25888-1l.html 25888-1l-notref.html
== 25888-1r.html 25888-1r-ref.html
Expand Down
57 changes: 22 additions & 35 deletions parser/html/javasrc/StateSnapshot.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2009-2010 Mozilla Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

Expand All @@ -37,12 +37,10 @@ public class StateSnapshot<T> implements TreeBuilderState<T> {

private final T headPointer;

private final T deepTreeSurrogateParent;

private final int mode;

private final int originalMode;

private final boolean framesetOk;

private final boolean needToDropLF;
Expand All @@ -55,7 +53,6 @@ public class StateSnapshot<T> implements TreeBuilderState<T> {
* @param templateModeStack
* @param formPointer
* @param headPointer
* @param deepTreeSurrogateParent
* @param mode
* @param originalMode
* @param framesetOk
Expand All @@ -64,21 +61,20 @@ public class StateSnapshot<T> implements TreeBuilderState<T> {
*/
StateSnapshot(StackNode<T>[] stack,
StackNode<T>[] listOfActiveFormattingElements, int[] templateModeStack, T formPointer,
T headPointer, T deepTreeSurrogateParent, int mode, int originalMode,
T headPointer, int mode, int originalMode,
boolean framesetOk, boolean needToDropLF, boolean quirks) {
this.stack = stack;
this.listOfActiveFormattingElements = listOfActiveFormattingElements;
this.templateModeStack = templateModeStack;
this.formPointer = formPointer;
this.headPointer = headPointer;
this.deepTreeSurrogateParent = deepTreeSurrogateParent;
this.mode = mode;
this.originalMode = originalMode;
this.framesetOk = framesetOk;
this.needToDropLF = needToDropLF;
this.quirks = quirks;
}

/**
* @see nu.validator.htmlparser.impl.TreeBuilderState#getStack()
*/
Expand Down Expand Up @@ -109,25 +105,16 @@ public T getFormPointer() {

/**
* Returns the headPointer.
*
*
* @return the headPointer
*/
public T getHeadPointer() {
return headPointer;
}

/**
* Returns the deepTreeSurrogateParent.
*
* @return the deepTreeSurrogateParent
*/
public T getDeepTreeSurrogateParent() {
return deepTreeSurrogateParent;
}

/**
* Returns the mode.
*
*
* @return the mode
*/
public int getMode() {
Expand All @@ -136,7 +123,7 @@ public int getMode() {

/**
* Returns the originalMode.
*
*
* @return the originalMode
*/
public int getOriginalMode() {
Expand All @@ -145,7 +132,7 @@ public int getOriginalMode() {

/**
* Returns the framesetOk.
*
*
* @return the framesetOk
*/
public boolean isFramesetOk() {
Expand All @@ -154,7 +141,7 @@ public boolean isFramesetOk() {

/**
* Returns the needToDropLF.
*
*
* @return the needToDropLF
*/
public boolean isNeedToDropLF() {
Expand All @@ -163,13 +150,13 @@ public boolean isNeedToDropLF() {

/**
* Returns the quirks.
*
*
* @return the quirks
*/
public boolean isQuirks() {
return quirks;
}

/**
* @see nu.validator.htmlparser.impl.TreeBuilderState#getListOfActiveFormattingElementsLength()
*/
Expand Down
Loading

0 comments on commit b245e01

Please sign in to comment.