Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Issue 21182003: Remove NonSelectableText subclass of Text (Closed)

Created:
7 years, 4 months ago by esprehn
Modified:
6 years, 11 months ago
Reviewers:
tkent, eseidel, ojan
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Remove NonSelectableText subclass of Text We can teach Text::createTextRenderer how to create these special types of text renderers and make make createTextRenderer non-virtual again. The only reason it exists outside createRenderer was to make it non-virtual. If we do decide to make it virtual again we should move createRenderer back up to Node and use that. Originally I tried to just use a plain Text node but it broke text selection behavior for <input type="button"> because RenderTextFragment had special behavior with an override of canBeSelectionLeaf that made the text only selectable if the renderer is editable (ex. contenteditable=true around the button). BUG=265699

Patch Set 1 #

Patch Set 2 : Only remove dead class for now #

Patch Set 3 : Use createTextRenderer and RenderTextFragment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -24 lines) Patch
M Source/core/dom/NodeRenderingContext.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Text.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/dom/Text.cpp View 1 2 5 chunks +15 lines, -1 line 0 comments Download
M Source/core/html/BaseButtonInputType.cpp View 1 1 chunk +1 line, -21 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
esprehn
7 years, 4 months ago (2013-07-30 01:23:03 UTC) #1
ojan
lgtm I'm not sure we ever need to make button text unselectable. Seems fine as ...
7 years, 4 months ago (2013-07-30 01:35:31 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/21182003/3001
7 years, 4 months ago (2013-07-30 01:38:24 UTC) #3
esprehn
On 2013/07/30 01:35:31, ojan wrote: > lgtm > > I'm not sure we ever need ...
7 years, 4 months ago (2013-07-30 01:38:29 UTC) #4
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=367
7 years, 4 months ago (2013-07-30 05:54:45 UTC) #5
esprehn
This seems to fail editing selection tests now: editing/selection/3690703-2.html editing/selection/3690703.html editing/selection/3690719.html editing/selection/selection-button-text.html So the RenderTextFragment ...
7 years, 4 months ago (2013-07-30 07:51:02 UTC) #6
eseidel
It's trivial to drag select into a button: data:text/html,<button>foo</button> I'm not sure that was an ...
7 years, 4 months ago (2013-07-30 08:00:46 UTC) #7
esprehn
On 2013/07/30 08:00:46, eseidel wrote: > It's trivial to drag select into a button: > ...
7 years, 4 months ago (2013-07-30 08:05:48 UTC) #8
esprehn
7 years, 4 months ago (2013-07-30 10:12:20 UTC) #9
I managed to get this to work, but it turns out we do need the
RenderTextFragment weirdness to match the selection behavior for buttons. It
looks like my bug isn't quite right, the text not being anonymous didn't make it
selectable in normal cases, but it does make it selectable sometimes (ex. right
click on a single word in the button).

Making this change would let us devirtualize createTextRenderer again, but it
does mean an input button specific hack in Text.cpp.

eseidel, ojan? What do you think, is this change good/bad? :)

Powered by Google App Engine
This is Rietveld 408576698