summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvador Zalapa2013-01-18 13:47:36 (EST)
committer Nick Sandonato2013-01-29 17:17:22 (EST)
commit5b29d6889cf4e5ae2199d2c84e7f6531749932ce (patch)
treee7118fd9445f12bc50f5b6be5474fc589f54c15c
parent4972b14ca3cbeb4468f6964b1b8122274ba9cec1 (diff)
downloadwebtools.sourceediting-5b29d6889cf4e5ae2199d2c84e7f6531749932ce.zip
webtools.sourceediting-5b29d6889cf4e5ae2199d2c84e7f6531749932ce.tar.gz
webtools.sourceediting-5b29d6889cf4e5ae2199d2c84e7f6531749932ce.tar.bz2
[398326] org.w3c.dom.DOMException occurs after editing css file via properties editorv201301292217
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java13
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java13
2 files changed, 20 insertions, 6 deletions
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
index e9e1d0b..b1e3b74 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2012 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.wst.css.core.internal.document;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
@@ -958,15 +959,15 @@ class CSSDeclarationItemParser {
return newItem;
}
- void setupValues(ICSSStyleDeclItem item, IStructuredDocumentRegion parentRegion, ITextRegionList nodeRegions, String value) {
+ void setupValues(ICSSStyleDeclItem item, IStructuredDocumentRegion parentRegion, ITextRegionList nodeRegions, List valueList) {
fParentRegion = parentRegion;
- setupValues(item, nodeRegions, value);
+ setupValues(item, nodeRegions, valueList);
}
/**
* nodeRegions must be broken. If you need after, make copy of them.
*/
- private void setupValues(ICSSStyleDeclItem item, ITextRegionList nodeRegions, String propertyValue) {
+ private void setupValues(ICSSStyleDeclItem item, ITextRegionList nodeRegions, List propertyValueList) {
if (item == null) {
return;
}
@@ -977,6 +978,7 @@ class CSSDeclarationItemParser {
String propertyName = item.getPropertyName().toLowerCase();
boolean bFont = (propertyName.equals(PropCMProperty.P_FONT));
// (short-hand) font
+ String propertyValue = null;
int status = (propertyName.equals(PropCMProperty.P_VOICE_FAMILY) || propertyName.equals(PropCMProperty.P_FONT_FAMILY)) ? S_COMMA_SEPARATION : S_NORMAL;
while (!nodeRegions.isEmpty()) {
value = null;
@@ -984,6 +986,9 @@ class CSSDeclarationItemParser {
if (region == null) {
continue;
}
+ if (propertyValueList != null && !propertyValueList.isEmpty()){
+ propertyValue = (String) propertyValueList.remove(0);
+ }
String type = region.getType();
// if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type
// == CSSRegionContexts.CSS_RBRACE) {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
index 5fed31c..4be99ad 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2012 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,9 @@ package org.eclipse.wst.css.core.internal.document;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
@@ -22,6 +25,7 @@ import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue
import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
import org.w3c.dom.DOMException;
@@ -248,7 +252,12 @@ class CSSStyleDeclItemImpl extends CSSStructuredDocumentRegionContainer implemen
itemParser.setStructuredDocumentTemporary(true);
// make a copy of nodelist because setupValues will destroy list
ITextRegionList nodeList = new TextRegionListImpl(node.getRegions());
- itemParser.setupValues(this, node, nodeList, value);
+ List nodeValuesList = new ArrayList();;
+ for (int i=0;i<nodeList.size();i++){
+ ITextRegion textRegion = nodeList.get(i);
+ nodeValuesList.add(value.substring(textRegion.getStart(), textRegion.getTextEnd()));
+ }
+ itemParser.setupValues(this, node, nodeList, nodeValuesList);
}
/**