Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 e9e1d0bca7..b1e3b74389 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 5fed31cf4a..4be99ad26b 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);
}
/**

Back to the top