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

HTML style attribute inconsistency #80

Open
ctjhoa opened this issue Aug 3, 2019 · 4 comments
Open

HTML style attribute inconsistency #80

ctjhoa opened this issue Aug 3, 2019 · 4 comments

Comments

@ctjhoa
Copy link

ctjhoa commented Aug 3, 2019

Hi,

I found an inconsistent behavior depending on ember versions and ember-angle-bracket-invocation-polyfill.

Here is my ember-angle-bracket-invocation-polyfill version: 2.0.1 (but I reproduce the same issue in 1.3.1)

With classic component declaration:

{{test-me style="color: red" }}

In Ember 2.18.2: the style attribute doesn't exist in the final DOM.
In Ember 3.4.4: the style attribute doesn't exist in the final DOM.

If I try this:

<TestMe style="color: red" />

In Ember 2.18.2: the style attribute doesn't exist in the final DOM.
In Ember 3.4.4: the style attribute exist in the final DOM.

IMO the expected behavior is that style attribute should be transferred to the final HTML node as style isn't prefixed with @.

If I try with another attribute than style (like data-foobar="foobar") it is transferred to the final HTML node as expected regarding the Ember versions

@ctjhoa
Copy link
Author

ctjhoa commented Aug 3, 2019

After further investigation it appears on Ember versions < 3.1

ctjhoa added a commit to ctjhoa/ember-angle-bracket-invocation-polyfill that referenced this issue Aug 3, 2019
@ctjhoa
Copy link
Author

ctjhoa commented Aug 3, 2019

I've created a PR which add my test case (feel free to close it).
Here are ember try:each results:

------ RESULTS ------

Scenario ember-lts-2.12: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~2.12.0            │ 2.12.2                       │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-lts-2.16: FAIL
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~2.16.0            │ 2.16.4                       │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-lts-2.18: FAIL
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~2.18.0            │ 2.18.2                       │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-3.1: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~3.1.0             │ 3.1.4                        │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-3.2: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~3.2.0             │ 3.2.2                        │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-3.3: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~3.3.0             │ 3.3.2                        │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-lts-3.4: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~3.4.0             │ 3.4.8                        │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-lts-3.8: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ ~3.8.0             │ 3.8.3                        │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-release: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ https://s3.amazon… │ 3.11.1-release+c0871674      │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-beta: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ https://s3.amazon… │ 3.12.0-beta.1.beta+60c79793  │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-canary: SUCCESS
Command run: ember test
┌────────────────────┬────────────────────┬──────────────────────────────┬──────────┐
│ Dependency         │ Expected           │ Used                         │ Type     │
├────────────────────┼────────────────────┼──────────────────────────────┼──────────┤
│ ember-source       │ https://s3.amazon… │ 3.13.0-canary+a1b5a6b6       │ yarn     │
└────────────────────┴────────────────────┴──────────────────────────────┴──────────┘

Scenario ember-default: SUCCESS
Command run: ember test

2 scenarios failed
10 scenarios succeeded
12 scenarios run
ember try:each  198.56s user 33.77s system 58% cpu 6:35.87 total

@rwjblue
Copy link
Member

rwjblue commented Oct 31, 2019

Just wanted to point out that the two invocations are actually different:

If your classic component (curly) invocation was:

{{test-me style="color: red" }}

Then your angle bracket invocation should be:

<TestMe @style="color: red" />

But in your original description you mentioned that you used <TestMe style="color: red" />.

@ctjhoa
Copy link
Author

ctjhoa commented Oct 31, 2019

@rwjblue yes it was just to give an output comparison but invocations are different. Do you have any hint where to start to look at to contribute to the polyfill?

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

No branches or pull requests

2 participants