Bug 89075 - [Shadow][Editing] Selection will break editing boundaries in Shadow DOM.
Summary: [Shadow][Editing] Selection will break editing boundaries in Shadow DOM.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shinya Kawanaka
URL:
Keywords:
Depends on:
Blocks: 82697
  Show dependency treegraph
 
Reported: 2012-06-14 01:42 PDT by Shinya Kawanaka
Modified: 2012-06-20 17:11 PDT (History)
14 users (show)

See Also:


Attachments
Repro (335 bytes, text/html)
2012-06-14 01:42 PDT, Shinya Kawanaka
no flags Details
Patch (9.23 KB, patch)
2012-06-20 14:02 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2012-06-14 01:42:18 PDT
Created attachment 147515 [details]
Repro

Select from inside of <span contenteditable>hoge</span> to table.
Comment 1 Shinya Kawanaka 2012-06-14 01:44:02 PDT
Try selection twice. The first selection won't break the boundary... I don't know why.
Comment 2 Shinya Kawanaka 2012-06-19 17:43:25 PDT
I and rniwa investigated this issue.

The problem will be m_style->inheritFrom() in StyleResolver::applyMatchedProperty(). Actually inheritFrom() does not copy "-webkit-user-modify" (i.e. contenteditable) if the element is on the shadow boundary (element's host is ShadowRoot). 

Maybe inheritFrom() is abused in various places to copy inherit values... We should create another function copyFrom() for the purpose.
Comment 3 Shinya Kawanaka 2012-06-19 18:30:39 PDT
Actually this bug seems caused by the patch for Bug 88514.
Bug 88514 test case will be failed if I made a patch like the last comment... I should investigate this more..., but it seems I'm moving forward.
Comment 4 Shinya Kawanaka 2012-06-20 14:02:45 PDT
Created attachment 148650 [details]
Patch
Comment 5 Ryosuke Niwa 2012-06-20 14:33:12 PDT
Comment on attachment 148650 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148650&action=review

> Source/WebCore/css/StyleResolver.cpp:2952
> -        if (m_parentStyle->inheritedDataShared(cacheItem->parentRenderStyle.get())) {
> +        if (m_parentStyle->inheritedDataShared(cacheItem->parentRenderStyle.get()) && !isAtShadowBoundary(element)) {

I see. The problem is that the parent renderer is the shadow host so we're tricked to think that this element's style matches that of a "light" child of the shadow host (outside of the shadow DOM).
This patch looks right but probably needs kling or antti's blessing.
Comment 6 WebKit Review Bot 2012-06-20 17:11:01 PDT
Comment on attachment 148650 [details]
Patch

Clearing flags on attachment: 148650

Committed r120887: <http://trac.webkit.org/changeset/120887>
Comment 7 WebKit Review Bot 2012-06-20 17:11:08 PDT
All reviewed patches have been landed.  Closing bug.