LayoutTests/ChangeLog

 12011-06-02 MORITA Hajime <morrita@google.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION: Cloned text <progress> and <meter> doesn't work well
 6 https://bugs.webkit.org/show_bug.cgi?id=61986
 7
 8 Checked pseudo classs ids which are only available for correct shadow elements.
 9
 10 * fast/dom/HTMLMeterElement/meter-clone-expected.txt: Added.
 11 * fast/dom/HTMLMeterElement/meter-clone.html: Added.
 12 * fast/dom/HTMLProgressElement/progress-clone-expected.txt: Added.
 13 * fast/dom/HTMLProgressElement/progress-clone.html: Added.
 14
1152011-06-02 Kent Tamura <tkent@chromium.org>
216
317 Reviewed by Dimitri Glazkov.

LayoutTests/fast/dom/HTMLMeterElement/meter-clone-expected.txt

 1PASS cloned.value is target.value
 2PASS layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild) is layoutTestController.shadowPseudoId(targetShadowRoot.firstChild)
 3PASS layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild.firstChild) is layoutTestController.shadowPseudoId(targetShadowRoot.firstChild.firstChild)
 4PASS successfullyParsed is true
 5
 6TEST COMPLETE
 7

LayoutTests/fast/dom/HTMLMeterElement/meter-clone.html

 1<!html>
 2<html>
 3<head>
 4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
 5<script src="../../js/resources/js-test-pre.js"></script>
 6</head>
 7<body>
 8<p id="description"></p>
 9<div id="console"></div>
 10<meter id="target" min="0" max="100" value="50" style="-webkit-appearance: none;" />
 11<script>
 12target = document.getElementById("target");
 13cloned = target.cloneNode();
 14document.body.insertBefore(cloned, target.nextSibling);
 15
 16targetShadowRoot = layoutTestController.shadowRoot(target);
 17clonedShadowRoot = layoutTestController.shadowRoot(cloned);
 18
 19shouldBe("cloned.value", "target.value");
 20shouldBe("layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild)", "layoutTestController.shadowPseudoId(targetShadowRoot.firstChild)");
 21shouldBe("layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild.firstChild)", "layoutTestController.shadowPseudoId(targetShadowRoot.firstChild.firstChild)");
 22
 23var successfullyParsed = true;
 24</script>
 25<script src="../../js/resources/js-test-post.js"></script>
 26</body>
 27</html>

LayoutTests/fast/dom/HTMLProgressElement/progress-clone-expected.txt

 1PASS cloned.value is target.value
 2PASS layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild) is layoutTestController.shadowPseudoId(targetShadowRoot.firstChild)
 3PASS layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild.firstChild) is layoutTestController.shadowPseudoId(targetShadowRoot.firstChild.firstChild)
 4PASS successfullyParsed is true
 5
 6TEST COMPLETE
 7

LayoutTests/fast/dom/HTMLProgressElement/progress-clone.html

 1<!html>
 2<html>
 3<head>
 4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
 5<script src="../../js/resources/js-test-pre.js"></script>
 6</head>
 7<body>
 8<p id="description"></p>
 9<div id="console"></div>
 10<progress id="target" min="0" max="100" value="50" style="-webkit-appearance: none;" ></progress>
 11<script>
 12target = document.getElementById("target");
 13cloned = target.cloneNode();
 14document.body.insertBefore(cloned, target.nextSibling);
 15
 16targetShadowRoot = layoutTestController.shadowRoot(target);
 17clonedShadowRoot = layoutTestController.shadowRoot(cloned);
 18
 19shouldBe("cloned.value", "target.value");
 20shouldBe("layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild)", "layoutTestController.shadowPseudoId(targetShadowRoot.firstChild)");
 21shouldBe("layoutTestController.shadowPseudoId(clonedShadowRoot.firstChild.firstChild)", "layoutTestController.shadowPseudoId(targetShadowRoot.firstChild.firstChild)");
 22
 23var successfullyParsed = true;
 24</script>
 25<script src="../../js/resources/js-test-post.js"></script>
 26</body>
 27</html>

Source/WebCore/ChangeLog

 12011-06-02 MORITA Hajime <morrita@google.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION: Cloned text <progress> and <meter> doesn't work well
 6 https://bugs.webkit.org/show_bug.cgi?id=61986
 7
 8 Implememented cloneElementWithoutAttributesAndChildren() for shadows.
 9
 10 Tests: fast/dom/HTMLMeterElement/meter-clone.html
 11 fast/dom/HTMLProgressElement/progress-clone.html
 12
 13 * html/shadow/MeterShadowElement.h:
 14 (WebCore::MeterBarElement::cloneElementWithoutAttributesAndChildren):
 15 (WebCore::MeterValueElement::cloneElementWithoutAttributesAndChildren):
 16 * html/shadow/ProgressShadowElement.h:
 17 (WebCore::ProgressBarElement::cloneElementWithoutAttributesAndChildren):
 18 (WebCore::ProgressValueElement::cloneElementWithoutAttributesAndChildren):
 19
1202011-06-02 Hayato Ito <hayato@chromium.org>
221
322 Reviewed by Ryosuke Niwa.

Source/WebCore/html/shadow/MeterShadowElement.h

@@public:
5656
5757 static PassRefPtr<MeterBarElement> create(Document*);
5858 virtual const AtomicString& shadowPseudoId() const;
 59 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
5960};
6061
6162inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document* document)

@@inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document* document)
6364 return adoptRef(new MeterBarElement(document));
6465}
6566
 67inline PassRefPtr<Element> MeterBarElement::cloneElementWithoutAttributesAndChildren() const
 68{
 69 return create(document());
 70}
 71
6672
6773class MeterValueElement : public MeterShadowElement {
6874public:

@@public:
7278 }
7379
7480 virtual const AtomicString& shadowPseudoId() const;
 81 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
 82
7583 static PassRefPtr<MeterValueElement> create(Document*);
7684 void setWidthPercentage(double);
7785};

@@inline PassRefPtr<MeterValueElement> MeterValueElement::create(Document* documen
8189 return adoptRef(new MeterValueElement(document));
8290}
8391
 92inline PassRefPtr<Element> MeterValueElement::cloneElementWithoutAttributesAndChildren() const
 93{
 94 return create(document());
 95}
 96
8497}
8598
8699#endif

Source/WebCore/html/shadow/ProgressShadowElement.h

@@public:
5757
5858 static PassRefPtr<ProgressBarElement> create(Document*);
5959 virtual const AtomicString& shadowPseudoId() const;
 60 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
6061};
6162
6263inline PassRefPtr<ProgressBarElement> ProgressBarElement::create(Document* document)

@@inline PassRefPtr<ProgressBarElement> ProgressBarElement::create(Document* docum
6465 return adoptRef(new ProgressBarElement(document));
6566}
6667
 68inline PassRefPtr<Element> ProgressBarElement::cloneElementWithoutAttributesAndChildren() const
 69{
 70 return create(document());
 71}
6772
6873class ProgressValueElement : public ProgressShadowElement {
6974public:

@@public:
7378 }
7479
7580 virtual const AtomicString& shadowPseudoId() const;
 81 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
7682 static PassRefPtr<ProgressValueElement> create(Document*);
7783 void setWidthPercentage(double);
7884};

@@inline PassRefPtr<ProgressValueElement> ProgressValueElement::create(Document* d
8288 return adoptRef(new ProgressValueElement(document));
8389}
8490
 91inline PassRefPtr<Element> ProgressValueElement::cloneElementWithoutAttributesAndChildren() const
 92{
 93 return create(document());
 94}
 95
8596}
8697
8798#endif