Lines Matching refs:dom
43 const SkDOM& dom,
53 const SkDOM::Node* textElem = dom.getFirstChild(root, "text");
58 REPORTER_ASSERT(reporter, dom.getType(textElem) == SkDOM::kElement_Type);
60 const SkDOM::Node* textNode= dom.getFirstChild(textElem);
63 REPORTER_ASSERT(reporter, dom.getType(textNode) == SkDOM::kText_Type);
64 if (strcmp(expected, dom.getName(textNode)) != 0) {
65 SkDebugf("string fail %s == %s\n", expected, dom.getName(textNode));
67 REPORTER_ASSERT(reporter, strcmp(expected, dom.getName(textNode)) == 0);
72 const char* x = dom.findAttr(textElem, "x");
92 const char* y = dom.findAttr(textElem, "y");
115 SkDOM dom;
121 SkXMLParserWriter writer(dom.beginParsing());
126 check_text_node(reporter, dom, dom.finishParsing(), offset, 2, expected);
134 SkXMLParserWriter writer(dom.beginParsing());
139 check_text_node(reporter, dom, dom.finishParsing(), offset, 2, expected);
147 SkXMLParserWriter writer(dom.beginParsing());
151 check_text_node(reporter, dom, dom.finishParsing(), offset, 2, expected);
191 bool FindImageShaderNodes(skiatest::Reporter* reporter, const SkDOM* dom, const SkDOM::Node* root, in FindImageShaderNodes() argument
194 if (root == nullptr || dom == nullptr) { in FindImageShaderNodes()
200 const SkDOM::Node* rect = dom->getFirstChild(root, "rect"); in FindImageShaderNodes()
207 const SkDOM::Node* defs = dom->getFirstChild(root, "defs"); in FindImageShaderNodes()
213 const SkDOM::Node* pattern = dom->getFirstChild(defs, "pattern"); in FindImageShaderNodes()
220 const SkDOM::Node* image = dom->getFirstChild(pattern, "image"); in FindImageShaderNodes()
230 void ImageShaderTestSetup(SkDOM* dom, SkPaint* paint, int imageWidth, int imageHeight, in ImageShaderTestSetup() argument
234 SkXMLParserWriter writer(dom->beginParsing()); in ImageShaderTestSetup()
243 SkDOM dom; in DEF_TEST() local
247 ImageShaderTestSetup(&dom, &paint, imageWidth, imageHeight, rectWidth, rectHeight, in DEF_TEST()
250 const SkDOM::Node* root = dom.finishParsing(); in DEF_TEST()
254 FindImageShaderNodes(reporter, &dom, root, &patternNode, &imageNode, &rectNode); in DEF_TEST()
258 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth); in DEF_TEST()
259 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight); in DEF_TEST()
263 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "width"), "100%") == 0); in DEF_TEST()
264 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "height"), "100%") == 0); in DEF_TEST()
268 SkDOM dom; in DEF_TEST() local
272 ImageShaderTestSetup(&dom, &paint, imageWidth, imageHeight, rectWidth, rectHeight, in DEF_TEST()
275 const SkDOM::Node* root = dom.finishParsing(); in DEF_TEST()
276 const SkDOM::Node* innerSvg = dom.getFirstChild(root, "svg"); in DEF_TEST()
284 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode); in DEF_TEST()
288 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth); in DEF_TEST()
289 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight); in DEF_TEST()
293 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "width")) == imageWidth); in DEF_TEST()
294 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "height"), "100%") == 0); in DEF_TEST()
298 SkDOM dom; in DEF_TEST() local
302 ImageShaderTestSetup(&dom, &paint, imageNodeWidth, imageNodeHeight, rectNodeWidth, in DEF_TEST()
305 const SkDOM::Node* root = dom.finishParsing(); in DEF_TEST()
306 const SkDOM::Node* innerSvg = dom.getFirstChild(root, "svg"); in DEF_TEST()
314 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode); in DEF_TEST()
318 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageNodeWidth); in DEF_TEST()
319 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageNodeHeight); in DEF_TEST()
323 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "width"), "100%") == 0); in DEF_TEST()
324 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "height")) == imageNodeHeight); in DEF_TEST()
328 SkDOM dom; in DEF_TEST() local
332 ImageShaderTestSetup(&dom, &paint, imageWidth, imageHeight, rectWidth, rectHeight, in DEF_TEST()
335 const SkDOM::Node* root = dom.finishParsing(); in DEF_TEST()
338 const SkDOM::Node* innerSvg = dom.getFirstChild(root, "svg"); in DEF_TEST()
344 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode); in DEF_TEST()
348 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth); in DEF_TEST()
349 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight); in DEF_TEST()
351 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "width")) == imageWidth); in DEF_TEST()
352 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "height")) == imageHeight); in DEF_TEST()
356 SkDOM dom; in DEF_TEST() local
360 SkXMLParserWriter writer(dom.beginParsing()); in DEF_TEST()
365 const SkDOM::Node* rootElement = dom.finishParsing(); in DEF_TEST()
368 const SkDOM::Node* filterElement = dom.getFirstChild(rootElement, "filter"); in DEF_TEST()
371 const SkDOM::Node* floodElement = dom.getFirstChild(filterElement, "feFlood"); in DEF_TEST()
374 const SkDOM::Node* compositeElement = dom.getFirstChild(filterElement, "feComposite"); in DEF_TEST()
377 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(filterElement, "width"), "100%") == 0); in DEF_TEST()
378 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(filterElement, "height"), "100%") == 0); in DEF_TEST()
381 strcmp(dom.findAttr(floodElement, "flood-color"), "rgb(255,0,0)") == 0); in DEF_TEST()
382 REPORTER_ASSERT(reporter, atoi(dom.findAttr(floodElement, "flood-opacity")) == 1); in DEF_TEST()
384 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(compositeElement, "in"), "flood") == 0); in DEF_TEST()
385 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(compositeElement, "operator"), "in") == 0); in DEF_TEST()