This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new a1ae0e223 fix CSS children for JBurg
a1ae0e223 is described below
commit a1ae0e22391bb89ba50183492b92e8afcde6b2aa
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon May 13 09:28:39 2024 -0700
fix CSS children for JBurg
It was not expecting certain ICSSNodes to be added as children
Parents are okay, since JBurg doesn't use that
---
.../java/org/apache/royale/compiler/internal/css/CSSCombinator.java | 3 ++-
.../java/org/apache/royale/compiler/internal/css/CSSFontFace.java | 3 ++-
.../java/org/apache/royale/compiler/internal/css/CSSProperty.java | 3 ++-
.../java/org/apache/royale/compiler/internal/css/CSSSelector.java | 6 ++++--
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSCombinator.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSCombinator.java
index 80fed431b..3401285ce 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSCombinator.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSCombinator.java
@@ -40,7 +40,8 @@ public class CSSCombinator extends CSSNodeBase implements
ICSSCombinator
this.type = type;
selector.setParent(this);
- children.add(selector);
+ // don't use children.add() here because JBurg doesn't expect the
+ // selector to be part of the tree
// TODO: include the operator
span(selector);
}
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSFontFace.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSFontFace.java
index 4a1543bf9..9e0feac89 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSFontFace.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSFontFace.java
@@ -63,7 +63,8 @@ public class CSSFontFace extends CSSNodeBase implements
ICSSFontFace
if (properties != null)
{
- children.addAll(properties);
+ // don't use children.add() or addAll() here because JBurg doesn't
+ // expect the properties to be part of the tree
for (final CSSProperty property : properties)
{
property.setParent(this);
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
index 488a09813..66e230b02 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
@@ -38,7 +38,8 @@ public class CSSProperty extends CSSNodeBase implements
ICSSProperty
this.value = value;
value.setParent(this);
- children.add(value);
+ // don't use children.add() here because JBurg doesn't expect the value
+ // to be part of the tree
}
private final String normalizedName;
diff --git
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSSelector.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSSelector.java
index 7b4e857bc..28fcd153c 100644
---
a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSSelector.java
+++
b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSSelector.java
@@ -58,7 +58,8 @@ public class CSSSelector extends CSSNodeBase implements
ICSSSelector
if (combinator != null)
{
combinator.setParent(this);
- this.children.add(combinator);
+ // don't use children.add() here because JBurg doesn't expect the
+ // combinator to be part of the tree
if (combinator.getStart() < getStart())
{
setStart(combinator.getStart());
@@ -98,7 +99,8 @@ public class CSSSelector extends CSSNodeBase implements
ICSSSelector
setEndColumn(condition.getEndColumn());
}
}
- this.children.addAll(conditions);
+ // don't use children.add() or addAll() here because JBurg doesn't
+ // expect the conditions to be part of the tree
}
}