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

Drop IE Support #112

Open
CITguy opened this issue Jan 2, 2018 · 13 comments
Open

Drop IE Support #112

CITguy opened this issue Jan 2, 2018 · 13 comments

Comments

@CITguy
Copy link
Contributor

CITguy commented Jan 2, 2018

likely to be a long-lived issue

@CITguy CITguy added the Bug: IE label Mar 26, 2018
@HelixDesignSystem HelixDesignSystem locked and limited conversation to collaborators Apr 25, 2018
@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

Compiling to ES5

  • larger file size due to extra logic required to achieve similar functionality
  • does not have 1:1 feature parity with ES6
    • this will likely result in strange bugs surfacing in the future
    • eventually, polyfills won't be able to replicate new features in an ES5-compatible manner
      • it's not a matter of if but when

@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

ES5 Adapter

  • needed to convert ES5 logic to ES6 class syntax for custom element registration
  • requires hacks and redundant logic to function outside of HTML imports
  • complicates consumer setup

2018-05-15: with the release of Firefox 60, ES6 module loading may provide the means to stop using the adapter altogether.

2018-11-17: with @webcomponents/webcomponentsjs versions ^1.2.4 || ^2.0.4, the adapter is simpler to consume and no longer throws an error in IE.

@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

Limited CSS Layout Capabilities

  • Flexbox instead of Modern CSS Grid
  • Flexbox is not intended for 2D layout (hacks are in place to make it behave better, but not perfect)
  • IE has old implementation of css grid (useful, but limited)
    • Can use grid implementation for fixed layouts only.
    • Fluid CSS grid layouts (auto rows, auto margins, etc.) are impossible in IE.
    • Grid gap styling must be applied using margin on grid items (no -ms-* equivalent of grid-gap).
  • All other modern browsers have native implementation of latest CSS Grid specification.

Recommendation

When applying fluid CSS grid layouts to new or existing components, identify what the IE fallback will look like.

@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

Legacy CSS Grid instead of Flexbox

  • In cases where we need to implement scrollbars along a single dimension (horizontally or vertically) on elements that have fluid dimensions up to a maximum value (fill space if content is light, scroll if content is heavy), IE cannot properly trigger scrolling overflows with flexbox.
  • See this codepen example for a demonstration.

@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

Broken implementation of valid semantic HTML5 elements

  • For unknown elements, browsers will style them as inline elements. This is problematic when you want to use valid semantic HTML5 elements to provide accessibility support and the browser doesn't know about them.
  • As a workaround, we have to add additional markup (role="main", etc.) and CSS (main { display: block; }, etc.) in order to drag IE forward to modern times.

@CITguy
Copy link
Contributor Author

CITguy commented Apr 25, 2018

Platform Polyfills

  • Based on research around required polyfills, IE is the only browser that needs additional platform polyfills beyond what webcomponentsjs provides.
  • Maintaining polyfills adds development overhead.
  • Extra polyfills increase required asset size (directly affecting performance).

2018-05-15: This can be minimized with updates in #227 put on hold

@CITguy CITguy added this to the cryo milestone May 16, 2018
@CITguy
Copy link
Contributor Author

CITguy commented May 21, 2018

Limited Support for CSS Custom Properties

The ShadyCSS polyfill that's included with webcomponentsjs will detect if a CSS custom property is consumed in the Shadow DOM and will stamp a static value when it styles the Shady DOM elements. This is fine for default styles, but it prevents overriding values in the Light DOM for the following cases:

  • theming from Light DOM (not possible in IE without rewriting ShadyCSS styles)
  • overriding values to demonstrate component states, for visual regression (impossible/difficult to do visual regression tests in IE, because of this)

@CITguy
Copy link
Contributor Author

CITguy commented May 21, 2018

ShadyDOM Rewrites - CSS Styling Conflicts

ShadyDOM doesn't prevent Light DOM CSS from accidentally styling ShadyDOM markup.

Note: this isn't IE-specific, but it will eventually become an exclusive problem with IE (once modern browsers have native support for ShadowDOM).

To imitate ShadowDOM encapsulation the ShadyDOM polyfill rewrites markup and CSS to increase CSS specificity of rendered markup (essentially "faking" encapsulation by defining more specific CSS selectors).

For example:

<style scope="hx-thing">
  /* ShadyCSS Selectors */
  #wrapper.hx-thing { ... }
  #body.hx-thing { ... }
</style>
<style>
  /* Light DOM CSS selectors */
  #wrapper { ... }
  #body { ... }
</style>
<div id="wrapper">
  <hx-thing>
    <div id="wrapper" class="style-scope hx-thing">
      <div id="body">...</div>
    </div>
  </hx-thing>
</div>

In this scenario, the #wrapper selector could accidentally apply unwanted styling to the ShadyDOM markup.

Workaround - prefixed ShadyDOM selectors

To work around this issue, we have to make the selectors in the Shadow DOM more specific than Light DOM.

The simplest way to do this is to prefix the selectors with hx, so we'd end up with: (this could conflict with other ShadyDOM selectors)

The most stable way to work around this is to apply the BEM naming convention to IDs in the ShadowDOM. This prevents collisions in both Light DOM as well as ShadyDOM selectors across custom elements.

<style scope="hx-thing">
  /* ShadyCSS Selectors */
  #hxThing.hx-thing { ... }
  #hxThing__body.hx-thing { ... }
</style>
<style>
  /* LightDOM CSS Selectors */
  #wrapper { ... }
  #body { ... }
</style>
<div id="wrapper">
  <hx-thing>
    <div id="hxThing" class="style-scope hx-thing">
      <div id="hxThing__body">...</div>
    </div>
  </hx-thing>
</div>

Now, #wrapper won't match the ShadyDOM markup.

@CITguy
Copy link
Contributor Author

CITguy commented May 21, 2018

ShadyDOM Rewrites - Differing CSS Selectors in Light DOM

ShadyDOM modifies the generated DOM to the point of requiring two different CSS selectors in order to target the same element.

native ShadowDOM supported

<hx-thing icon="key">
  <p>Thing content!</p>
</hx-thing>

The hx-thing > p selector (specificity:002) will select the Light DOM paragraph.

polyfilled via ShadyDOM

<hx-thing icon="key">
  <div id="wrapper" class="style-scope hx-thing">
    <hx-icon type="key" class="style-scope hx-thing"></hx-icon>
    <span class="style-scope hx-thing">
      <p>Thing content!</p>
    </span>
  </div>
</hx-thing>

The #wrapper.hx-thing > span > p selector (specificity: 112) is required to target the paragraph in a polyfilled browser. This selector is highly dependent on the ShadowDOM markup structure, and is extremely brittle. The only way around this requires bloating either the CSS (with more specific selectors) or the markup (with extra ids or classes) in order to guarantee the same target across browsers.

This affects:

  • Light DOM styling
  • Testing

Future

Eventually, this won't be a problem for evergreen browsers. As they gain native ShadowDOM and Custom Element support, the ShadyDOM rewrites will no longer be applied. However, as long as we support IE, this will always be an issue, because IE will always require the polyfill.

@CITguy CITguy removed the Bug: IE label Jun 19, 2018
@CITguy
Copy link
Contributor Author

CITguy commented Jul 23, 2018

window.opener API exploits

External links to untrusted URLs can fall victim to exploits in the window.opener API. You can view a safe demonstration of how this could be used by hackers at https://mathiasbynens.github.io/rel-noopener/.

The best solution to this problem is to apply rel="noopener noreferrer" to any external link (<a href="" target="_blank">). However, there are two big problems.

  1. IE11 doesn't support noopener
  2. Only IE11 on later versions of Windows 10 (creators update) supports noreferrer

This is a security risk that we cannot completely prevent on IE, because it requires updates to core code in the browser, but IE is no longer receiving updates from Microsoft.

@CITguy CITguy modified the milestones: cryo, 1.0.0 Aug 7, 2018
@CITguy
Copy link
Contributor Author

CITguy commented Sep 6, 2018

min-height/min-width affects Drag and Drop events

Details: TBD

@CITguy
Copy link
Contributor Author

CITguy commented Nov 17, 2018

HTMLElement.prototype.tabIndex broken with no intent to fix

Edge 12-17 and IE incorrectly return 0 for non-interactive elements without an explicit [tabindex] attribute.

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4365703/

  • This bug will not be fixed in IE.

@CITguy CITguy added Milestone External Pertains to external code/binary BUG 🔑 Security and removed 🔑 Security BUG External Pertains to external code/binary labels Feb 28, 2019
@CITguy
Copy link
Contributor Author

CITguy commented Jun 27, 2019

Poor / Degraded Accessibility

File Input (input[type="file"])

input[type="file"]:active never matches when using a keyboard

  • IE (all versions)
  • Edge 12-18

This prevents visual feedback when pressing SPACE (keydown) while focused on a file input. However, it still works when you use a mouse (mousedown).

input[type="file"] has TWO "tab stops"

  1. One tab stop for a read-only text input that displays the selected file name.
  2. Another for a button to open a file selection dialog.

The file input widget is rendered by the operating system (i.e., Windows), not the browser. There's no known CSS property or JavaScript configuration to remove the extra tab on the read-only text input.

  • IE (all versions)
  • Edge 12-18

@100stacks 100stacks linked a pull request Jul 28, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant