Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a blur() method to selection-contenteditable-011.html #25642

Merged
merged 1 commit into from Sep 30, 2020

Conversation

TalbotG
Copy link
Contributor

@TalbotG TalbotG commented Sep 20, 2020

/css/css-pseudo/selection-contenteditable-011.html

Right now, both Chrome 87 and Safari Preview 113 appear to be styling the border of focused <div contenteditable="true"> in the selection-contenteditable-011.html . This focusing creates an additional (and unwanted) cause of failure in both browsers. The addition of the blur() in the code of this selection-contenteditable-011.html test is trying to neutralize such focusing style. [If this works for selection-contenteditable-011.html , then I will be able to add the same blur() code into selection-textarea-011.html later.]

On my website,

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/selection-contenteditable-011-new.html

[Addendum: now that I am thinking more about it, maybe it was better to add focus() to the <div contenteditable="true"> in the reference file instead of adding blur() to the <div contenteditable="true"> of the test.]

@TalbotG TalbotG self-assigned this Sep 20, 2020
@TalbotG TalbotG removed the request for review from plinss September 20, 2020 22:18
Copy link
Contributor

@fantasai fantasai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect your alternative .focus()-on-the-reference method would be better, but I will approve this for now.

@TalbotG
Copy link
Contributor Author

TalbotG commented Sep 30, 2020

With this change, I will see how selection-contenteditable-011.html test is rendered in Chrome 87+ and Safari Preview 113+:
[Edit]
https://wpt.fyi/results/css/css-pseudo/selection-contenteditable-011.html?label=master
[/Edit]
I may eventually add focus() to the

in the reference file instead or, like you said, add .focus()-on-the-reference.

@TalbotG TalbotG merged commit 14003ac into web-platform-tests:master Sep 30, 2020
@TalbotG
Copy link
Contributor Author

TalbotG commented Oct 8, 2020

Blurrying the <div contenteditable="true"> of the test is accomplishing what I wanted in Chrome 87 and in Edge 87: the div remains selected. But not so in Safari 113 preview macOS 10.15: blurrying <div contenteditable="true"> of the test in Safari 113 preview unselect the div. So, now I must go with the focusing of the div of the reference file. This is now on my october to-do list.

@TalbotG
Copy link
Contributor Author

TalbotG commented Oct 22, 2020

Right now, both Chrome 87 and Safari Preview 113 appear to be styling the border of focused <div contenteditable="true"> in the selection-contenteditable-011.html .

Chrome 88 has this user agent stylesheet rule:

:focus {
    outline: -webkit-focus-ring-color auto 1px;
}

An unexpected problem with focusing is that focus()-ing after select()-ing actually deselects the contenteditable element in Chrome 88. So now, this is an additional constraint and an unexpected one... and I have not even looked at Safari 114 right now

@TalbotG
Copy link
Contributor Author

TalbotG commented Oct 22, 2020

In a few min., I will create another PR which will use

document.getElementById("test").focus();

document.getElementById("test").style.caretColor = "yellow";

only in the reference file "selection-contenteditable-011-ref.html" and only on the contenteditable element. The blur() method will be removed from the "selection-contenteditable-011.html" test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants