Changeset 131464 in webkit


Ignore:
Timestamp:
Oct 16, 2012 9:23:43 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Meta] [Shadow] contenteditable attribute for distributed nodes.
https://bugs.webkit.org/show_bug.cgi?id=90017

Patch by Takashi Sakamoto <tasak@google.com> on 2012-10-16
Reviewed by Dimitri Glazkov.

Source/WebCore:

If an element is distributed to an insertion point, the element's
webkit-user-modify is inherited from its shadow host.

No new tests, because the existing test: user-modify-inheritance.html
covers this change.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::styleForElement):
After an element inherits a style from its parent, override user-modify
by using the shadow host's style if the element is distributed.

LayoutTests:

  • fast/dom/shadow/user-modify-inheritance-expected.txt:
  • fast/dom/shadow/user-modify-inheritance.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r131462 r131464  
     12012-10-16  Takashi Sakamoto  <tasak@google.com>
     2
     3        [Meta] [Shadow] contenteditable attribute for distributed nodes.
     4        https://bugs.webkit.org/show_bug.cgi?id=90017
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/user-modify-inheritance-expected.txt:
     9        * fast/dom/shadow/user-modify-inheritance.html:
     10
    1112012-10-16  Vsevolod Vlasov  <vsevik@chromium.org>
    212
  • trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt

    r126442 r131464  
    1111PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName) is "read-write"
    1212PASS getUserModifyProperty("child-a") is "read-write"
    13 FAIL getUserModifyProperty("child-b") should be read-write. Was read-only.
     13PASS getUserModifyProperty("child-b") is "read-write"
     14PASS getUserModifyProperty("child-c") is "read-only"
     15PASS getUserModifyProperty("child-d") is "read-only"
    1416PASS successfullyParsed is true
    1517
  • trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance.html

    r126442 r131464  
    1414<div id="non-contenteditable-host3"></div>
    1515<div id="sandbox"></div>
     16<div id="sandbox2"></div>
    1617<pre id="console"></pre>
    1718<script>
     
    6364
    6465shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write');
    65 /* FIXME(90017): css property: -user-modify should be inherited from parent.*/
    6666shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write');
     67
     68document.getElementById('sandbox2').appendChild(
     69    createDOM('div', {'id': 'host', 'contenteditable': 'false'},
     70              createShadowRoot(createDOM('content', {'select': '#child-c'}),
     71                               createDOM('div', {'contenteditable' : 'true'},
     72                                         createDOM('content', {'select': '#child-d'}))),
     73              createDOM('div', {'id': 'child-c'}),
     74              createDOM('div', {'id': 'child-d'})));
     75
     76shouldBeEqualToString('getUserModifyProperty("child-c")', 'read-only');
     77shouldBeEqualToString('getUserModifyProperty("child-d")', 'read-only');
    6778
    6879</script>
  • trunk/Source/WebCore/ChangeLog

    r131462 r131464  
     12012-10-16  Takashi Sakamoto  <tasak@google.com>
     2
     3        [Meta] [Shadow] contenteditable attribute for distributed nodes.
     4        https://bugs.webkit.org/show_bug.cgi?id=90017
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        If an element is distributed to an insertion point, the element's
     9        webkit-user-modify is inherited from its shadow host.
     10
     11        No new tests, because the existing test: user-modify-inheritance.html
     12        covers this change.
     13
     14        * css/StyleResolver.cpp:
     15        (WebCore::StyleResolver::styleForElement):
     16        After an element inherits a style from its parent, override user-modify
     17        by using the shadow host's style if the element is distributed.
     18
    1192012-10-16  Vsevolod Vlasov  <vsevik@chromium.org>
    220
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r131443 r131464  
    15441544        m_parentStyle = cloneForParent.get();
    15451545    }
     1546    // contenteditable attribute (implemented by -webkit-user-modify) should
     1547    // be propagated from shadow host to distributed node.
     1548    if (m_distributedToInsertionPoint) {
     1549        ASSERT(element->parentElement());
     1550        ASSERT(element->parentElement()->renderStyle());
     1551        m_style->setUserModify(element->parentElement()->renderStyle()->userModify());
     1552    }
    15461553
    15471554    if (element->isLink()) {
Note: See TracChangeset for help on using the changeset viewer.