InspectorTest.addResult("");
InspectorTest.addResult("=== Stylesheet-for-inline-style text ===");
InspectorTest.addResult(result);
- CSSAgent.setStyleSheetText(inlineStyle.styleId.styleSheetId, "", setTextCallback);
+ CSSAgent.setStyleSheetText(inlineStyle.styleSheetId, "", setTextCallback);
}
function callback(error, inlineStyle, attributesStyle)
InspectorTest.addResult("");
InspectorTest.addResult("=== Attributes style for table ===");
InspectorTest.dumpStyle(attributesStyle);
- CSSAgent.getStyleSheetText(inlineStyle.styleId.styleSheetId, textCallback.bind(this, inlineStyle));
+ CSSAgent.getStyleSheetText(inlineStyle.styleSheetId, textCallback.bind(this, inlineStyle));
}
function nodeCallback(node)
}
InspectorTest.addResult("");
InspectorTest.addResult("=== After style text set ===");
- loadAndDumpStyleSheet(style.styleId.styleSheetId, next);
+ loadAndDumpStyleSheet(style.styleSheetId, next);
+ }
+
+ function collapseToStart(range)
+ {
+ return {
+ startLine: range.startLine,
+ startColumn: range.startColumn,
+ endLine: range.startLine,
+ endColumn: range.startColumn,
+ };
}
function setStyleText(rule)
{
- CSSAgent.setPropertyText(rule.style.styleId, 0, "", true);
- CSSAgent.setPropertyText(rule.style.styleId, 0, "", true);
+ CSSAgent.setPropertyText(rule.style.styleSheetId, rule.style.cssProperties[1].range, "");
+ CSSAgent.setPropertyText(rule.style.styleSheetId, rule.style.cssProperties[0].range, "");
// This operation should not update the style as the new property text is not parsable.
- CSSAgent.setPropertyText(rule.style.styleId, 0, "zzz;", false);
- CSSAgent.setPropertyText(rule.style.styleId, 0, "color: white; background: black;", false, didSetStyleText);
+ CSSAgent.setPropertyText(rule.style.styleSheetId, collapseToStart(rule.style.range), "zzz;");
+ CSSAgent.setPropertyText(rule.style.styleSheetId, collapseToStart(rule.style.range), "color: white; background: black;", didSetStyleText);
}
function didSetSelector(error, rule)
}
InspectorTest.addResult("");
InspectorTest.addResult("=== After selector set ===");
- loadAndDumpStyleSheet(rule.ruleId.styleSheetId, setStyleText.bind(this, rule));
+ loadAndDumpStyleSheet(rule.styleSheetId, setStyleText.bind(this, rule));
}
function setRuleSelector(rule)
{
- CSSAgent.setRuleSelector(rule.ruleId, "html *, body[foo=\"bar\"]", didSetSelector);
+ var orm = WebInspector.CSSRule.parsePayload(WebInspector.cssModel, rule);
+ CSSAgent.setRuleSelector(orm.styleSheetId, orm.selectorRange, "html *, body[foo=\"bar\"]", didSetSelector);
}
function onMatchedStylesForNode(error, matchedStyles)
InspectorTest.addResult("error: " + error);
return;
}
- CSSAgent.setPropertyText(rule.style.styleId, 0, "font-family: serif;", false, didSetStyleText);
+ CSSAgent.setPropertyText(rule.style.styleSheetId, {
+ startLine: rule.style.range.startLine,
+ startColumn: rule.style.range.startColumn,
+ endLine: rule.style.range.startLine,
+ endColumn: rule.style.range.startColumn
+ }, "font-family: serif;", didSetStyleText);
}
function viaInspectorStyleSheetCreated(error, styleSheetId)
InspectorTest.completeTest();
return;
}
- callback(WebInspector.CSSStyleDeclaration.parsePayload(payload));
+ callback(WebInspector.CSSStyleDeclaration.parsePayload(WebInspector.cssModel, payload));
}
function stylesCallback(error, matchedCSSRules)
// border-width: 0px;
// padding-top: 1px; [d]
- var styleId = matchedCSSRules[1].rule.style.styleId;
- var orm = WebInspector.CSSStyleDeclaration.parsePayload(matchedCSSRules[1].rule.style);
+ var orm = WebInspector.CSSStyleDeclaration.parsePayload(WebInspector.cssModel, matchedCSSRules[1].rule.style);
orm.propertyAt(0).setDisabled(true, step1);
function step1(orm)
function step2(orm)
{
- CSSAgent.setPropertyText(orm.id, 7, "font-size: 12px;", false, parseStylePayload.bind(null, step3));
+ CSSAgent.setPropertyText(orm.styleSheetId, orm.propertyAt(7).range.collapseToStart(), "font-size: 12px;", parseStylePayload.bind(null, step3));
}
function step3(orm)
{
- CSSAgent.setPropertyText(orm.id, 9, "font-size: 14px;", false, parseStylePayload.bind(null, step4));
+ CSSAgent.setPropertyText(orm.styleSheetId, orm.propertyAt(9).range.collapseToStart(), "font-size: 14px;", parseStylePayload.bind(null, step4));
}
function step4(orm)
function step5(orm)
{
- CSSAgent.setPropertyText(orm.id, 8, "border-width: 1px;", true, parseStylePayload.bind(null, step6));
+ CSSAgent.setPropertyText(orm.styleSheetId, orm.propertyAt(8).range, "border-width: 1px;", parseStylePayload.bind(null, step6));
}
function step6(orm)
function step7(orm)
{
- CSSAgent.setPropertyText(orm.id, 3, "", true, parseStylePayload.bind(null, step8));
+ CSSAgent.setPropertyText(orm.styleSheetId, orm.propertyAt(3).range, "", parseStylePayload.bind(null, step8));
}
function step8(orm)