Changeset 107050 in webkit


Ignore:
Timestamp:
Feb 8, 2012 12:57:08 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Stop calling Element::ensureShadowRoot() if it is used in construction phase.
https://bugs.webkit.org/show_bug.cgi?id=77929

Patch by Shinya Kawanaka <shinyak@google.com> on 2012-02-08
Reviewed by Hajime Morita.

ShadowRoot's life cycle can be consufing If Element::ensureShadowRoot() is used.
So we want to remove Element::ensureShadowRoot().
This patch replaces Element::ensureShadowRoot() if it is used in object construction phase.

No new tests, no change in behavior.

  • html/HTMLDetailsElement.cpp:

(WebCore::HTMLDetailsElement::createShadowSubtree):

  • html/HTMLKeygenElement.cpp:

(WebCore::HTMLKeygenElement::HTMLKeygenElement):

  • html/HTMLMeterElement.cpp:

(WebCore::HTMLMeterElement::createShadowSubtree):

  • html/HTMLProgressElement.cpp:

(WebCore::HTMLProgressElement::createShadowSubtree):

  • html/HTMLSummaryElement.cpp:

(WebCore::HTMLSummaryElement::createShadowSubtree):

  • html/HTMLTextAreaElement.cpp:

(WebCore::HTMLTextAreaElement::createShadowSubtree):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107049 r107050  
     12012-02-08  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Stop calling Element::ensureShadowRoot() if it is used in construction phase.
     4        https://bugs.webkit.org/show_bug.cgi?id=77929
     5
     6        Reviewed by Hajime Morita.
     7
     8        ShadowRoot's life cycle can be consufing If Element::ensureShadowRoot() is used.
     9        So we want to remove Element::ensureShadowRoot().
     10        This patch replaces Element::ensureShadowRoot() if it is used in object construction phase.
     11
     12        No new tests, no change in behavior.
     13
     14        * html/HTMLDetailsElement.cpp:
     15        (WebCore::HTMLDetailsElement::createShadowSubtree):
     16        * html/HTMLKeygenElement.cpp:
     17        (WebCore::HTMLKeygenElement::HTMLKeygenElement):
     18        * html/HTMLMeterElement.cpp:
     19        (WebCore::HTMLMeterElement::createShadowSubtree):
     20        * html/HTMLProgressElement.cpp:
     21        (WebCore::HTMLProgressElement::createShadowSubtree):
     22        * html/HTMLSummaryElement.cpp:
     23        (WebCore::HTMLSummaryElement::createShadowSubtree):
     24        * html/HTMLTextAreaElement.cpp:
     25        (WebCore::HTMLTextAreaElement::createShadowSubtree):
     26
    1272012-02-08  Nikolas Zimmermann  <nzimmermann@rim.com>
    228
  • trunk/Source/WebCore/html/HTMLDetailsElement.cpp

    r106926 r107050  
    110110{
    111111    ASSERT(!shadowRoot());
    112     ensureShadowRoot()->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, true);
    113     ensureShadowRoot()->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
     112
     113    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     114    root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, true);
     115    root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
    114116}
    115117
  • trunk/Source/WebCore/html/HTMLKeygenElement.cpp

    r106926 r107050  
    8686    }
    8787
    88     ensureShadowRoot()->appendChild(select, ec);
     88    ASSERT(!shadowRoot());
     89    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     90    root->appendChild(select, ec);
    8991}
    9092
  • trunk/Source/WebCore/html/HTMLMeterElement.cpp

    r106926 r107050  
    235235void HTMLMeterElement::createShadowSubtree()
    236236{
     237    ASSERT(!shadowRoot());
     238
    237239    RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
    238240    m_value = MeterValueElement::create(document());
    239241    ExceptionCode ec = 0;
    240242    bar->appendChild(m_value, ec);
    241     ensureShadowRoot()->appendChild(bar, ec);
     243
     244    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     245    root->appendChild(bar, ec);
    242246}
    243247
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r106926 r107050  
    154154void HTMLProgressElement::createShadowSubtree()
    155155{
     156    ASSERT(!shadowRoot());
     157
    156158    RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document());
    157159    m_value = ProgressValueElement::create(document());
    158     ExceptionCode ec = 0;
    159     bar->appendChild(m_value, ec);
    160     ensureShadowRoot()->appendChild(bar, ec);
     160    bar->appendChild(m_value, ASSERT_NO_EXCEPTION);
     161
     162    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     163    root->appendChild(bar, ASSERT_NO_EXCEPTION);
    161164}
    162165
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r106926 r107050  
    7474void HTMLSummaryElement::createShadowSubtree()
    7575{
    76     ExceptionCode ec = 0;
    77     ensureShadowRoot()->appendChild(DetailsMarkerControl::create(document()), ec, true);
    78     ensureShadowRoot()->appendChild(SummaryContentElement::create(document()), ec, true);
     76    ASSERT(!shadowRoot());
     77    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     78    root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, true);
     79    root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
    7980}
    8081
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r106926 r107050  
    8585void HTMLTextAreaElement::createShadowSubtree()
    8686{
    87     ExceptionCode ec = 0;
    88     ensureShadowRoot()->appendChild(TextControlInnerTextElement::create(document()), ec);
     87    ASSERT(!shadowRoot());
     88    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ASSERT_NO_EXCEPTION);
     89    root->appendChild(TextControlInnerTextElement::create(document()), ASSERT_NO_EXCEPTION);
    8990}
    9091
Note: See TracChangeset for help on using the changeset viewer.