Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Render text editor contents inside shadow DOM#3943

Merged
nathansobo merged 68 commits intomasterfrom
ns-text-editor-shadow-dom
Nov 5, 2014
Merged

Render text editor contents inside shadow DOM#3943
nathansobo merged 68 commits intomasterfrom
ns-text-editor-shadow-dom

Conversation

@nathansobo
Copy link
Contributor

Closes #1800

Tasks

  • Fix git diff styling
  • Fix specs
  • Fix loss of ability to insert text after autocompleting when the menu doesn't pop up
  • Add a feature flag

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason in particular to change these quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it just happened across a couple commits because I was interpolating a variable into that string for a while.

@nathansobo nathansobo force-pushed the ns-text-editor-shadow-dom branch 4 times, most recently from c655d8a to 16c5187 Compare October 29, 2014 17:37
@benogle benogle force-pushed the ns-text-editor-shadow-dom branch from 16c5187 to 494b767 Compare October 30, 2014 21:49
@nathansobo nathansobo force-pushed the ns-text-editor-shadow-dom branch 2 times, most recently from f3f7ac3 to 12a6095 Compare October 30, 2014 22:04
@benogle benogle force-pushed the ns-text-editor-shadow-dom branch from 12a6095 to 3d9eb86 Compare October 30, 2014 22:15
@nathansobo nathansobo force-pushed the ns-text-editor-shadow-dom branch from 11203e6 to 8dbdac7 Compare November 4, 2014 16:59
Nathan Sobo added 19 commits November 4, 2014 16:37
Themes aren’t applying correctly and there are issues with mini editors
but this basically works. I’m leaving the .editor node in the shadow
DOM for theme compatibility and because React still wants to render
into a wrapper element.
…instead of via the shadow DOM. We always honor the computed font
styles of the host element.
React event handlers don’t work because of the shadow DOM
Nathan Sobo and others added 21 commits November 4, 2014 16:37
The focusout event doesn’t seem to work for elements in the shadow DOM.
Other people seem to share this experience:

https://code.google.com/p/chromium/issues/detail?id=378163#c7
If stylesheet files are named with 2 extensions, the first extension is
used as the context argument when the package’s stylesheets are loaded.
This allows people to target the text editor by naming their stylesheet
`index.atom-text-editor.less`.
This avoids a race condition where stylesheets would be added after all
packages were deactivated and leak into the next spec.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
When the shadow DOM is enabled, this happens organically because the
focus is abstracted across the shadow boundary. Without that abstraction
boundary, we need to pretend that a blur of the hidden input is actually
a blur of the entire editor.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
@nathansobo nathansobo force-pushed the ns-text-editor-shadow-dom branch from 8428210 to badf172 Compare November 4, 2014 23:37
@nathansobo
Copy link
Contributor Author

This is ready to merge.
/cc @atom/core

Copy link
Contributor

Choose a reason for hiding this comment

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

Yay no more react class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, not quite. It's still there but no more reason to call it out in a class specifically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's what you said.

@benogle
Copy link
Contributor

benogle commented Nov 5, 2014

👍 Doesnt look crazy painful with the feature flag. Was wondering how you did the contextual styles with no shadow root, and the global style element looks pretty elegant. 💥 ⛵

@nathansobo
Copy link
Contributor Author

Thanks for the review. I'm going to merge this now so hold on to your 🎩.

nathansobo pushed a commit that referenced this pull request Nov 5, 2014
Render text editor contents inside shadow DOM
@nathansobo nathansobo merged commit 2c83c3f into master Nov 5, 2014
@nathansobo nathansobo deleted the ns-text-editor-shadow-dom branch November 5, 2014 16:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Certain CSS classes in syntax tokens cause issues

4 participants