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

fix(engine): issue 990 textContent and innerHTML restrictions #1001

Merged
merged 2 commits into from
Jan 25, 2019

Conversation

caridy
Copy link
Contributor

@caridy caridy commented Jan 22, 2019

fixes #990 and #991

assert.logError(`textContent is disallowed in Element unless \`lwc:dom="manual"\` directive is used in the template.`, this as Element);
}
if (this instanceof Element && options.isPortal !== true) {
assert.logError(`textContent is disallowed in Element unless \`lwc:dom="manual"\` directive is used in the template.`, this as Element);
Copy link
Member

Choose a reason for hiding this comment

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

Why is the this as Element typecasting necessary here?

Copy link
Contributor Author

@caridy caridy Jan 25, 2019

Choose a reason for hiding this comment

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

copy/paste, but I think we can remove it from this file since the instanceof is sufficient in ts3.x

assert.logError(`nodeValue is disallowed in Element unless \`lwc:dom="manual"\` directive is used in the template.`, this as Element);
}
if (this instanceof Element && options.isPortal !== true) {
assert.logError(`nodeValue is disallowed in Element unless \`lwc:dom="manual"\` directive is used in the template.`, this as Element);
Copy link
Member

Choose a reason for hiding this comment

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

Why is the this as Element typecasting necessary here?

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: f8423e8 | Target commit: bade856

lwc-engine-benchmark

table-append-1k metric base(f8423e8) target(bade856) trend
benchmark-table/append/1k duration 151.25 (±4.65 ms) 148.70 (±3.60 ms) -2.6ms (1.7%) 👍
table-clear-1k metric base(f8423e8) target(bade856) trend
benchmark-table/clear/1k duration 5.80 (±0.30 ms) 5.90 (±0.30 ms) +0.1ms (1.7%) 👌
table-create-10k metric base(f8423e8) target(bade856) trend
benchmark-table/create/10k duration 864.55 (±6.65 ms) 879.15 (±6.90 ms) +14.6ms (1.7%) 👎
table-create-1k metric base(f8423e8) target(bade856) trend
benchmark-table/create/1k duration 115.90 (±3.55 ms) 116.60 (±2.45 ms) +0.7ms (0.6%) 👌
table-update-10th-1k metric base(f8423e8) target(bade856) trend
benchmark-table/update-10th/1k duration 75.05 (±4.40 ms) 85.00 (±1.95 ms) +9.9ms (13.3%) 👎
tablecmp-append-1k metric base(f8423e8) target(bade856) trend
benchmark-table-component/append/1k duration 251.55 (±8.80 ms) 222.35 (±8.20 ms) -29.2ms (11.6%) 👍
tablecmp-clear-1k metric base(f8423e8) target(bade856) trend
benchmark-table-component/clear/1k duration 11.50 (±1.60 ms) 12.00 (±1.90 ms) +0.5ms (4.3%) 👌
tablecmp-create-10k metric base(f8423e8) target(bade856) trend
benchmark-table-component/create/10k duration 1760.50 (±10.10 ms) 1726.85 (±12.20 ms) -33.7ms (1.9%) 👍
tablecmp-create-1k metric base(f8423e8) target(bade856) trend
benchmark-table-component/create/1k duration 208.70 (±5.55 ms) 208.45 (±5.40 ms) -0.3ms (0.1%) 👌
tablecmp-update-10th-1k metric base(f8423e8) target(bade856) trend
benchmark-table-component/update-10th/1k duration 69.45 (±3.85 ms) 71.45 (±4.50 ms) +2.0ms (2.9%) 👌
wc-append-1k metric base(f8423e8) target(bade856) trend
benchmark-table-wc/append/1k duration 254.80 (±5.25 ms) 254.25 (±5.40 ms) -0.6ms (0.2%) 👌
wc-clear-1k metric base(f8423e8) target(bade856) trend
benchmark-table-wc/clear/1k duration 21.30 (±1.80 ms) 21.85 (±2.15 ms) +0.6ms (2.6%) 👌
wc-create-10k metric base(f8423e8) target(bade856) trend
benchmark-table-wc/create/10k duration 1962.45 (±18.75 ms) 1959.90 (±16.70 ms) -2.5ms (0.1%) 👌
wc-create-1k metric base(f8423e8) target(bade856) trend
benchmark-table-wc/create/1k duration 220.55 (±3.85 ms) 219.40 (±4.60 ms) -1.2ms (0.5%) 👌
wc-update-10th-1k metric base(f8423e8) target(bade856) trend
benchmark-table-wc/update-10th/1k duration 68.60 (±4.90 ms) 69.60 (±5.95 ms) +1.0ms (1.5%) 👌

@caridy caridy merged commit 514c1f5 into master Jan 25, 2019
@caridy caridy deleted the caridy/issue-990/220 branch January 25, 2019 20:07
ravijayaramappa added a commit that referenced this pull request Jan 20, 2020
* test: remove test for duplicate handlers

restriction was removed in #1193

* test: enable test for readonly properties

* test: enable test for dispatchEvent

* test: remove test for removing non-existent listener on custom element

* test: test setting innerHTML, outerHTML on host will throw

fixed in #1001

* test: enable tests migrated to karma suite

* test: more enabled tests

* test: revert the suite back to disabled state

* test: account for different error message across browsers

* test: error message in ie11 is taken care of

* fix: isConnected polyfill in IE11

fixes #987

* test: enable tests for #997 and #990 issue

Tests for #997 & #990

* test: enable test for iteration

fix #1285

* test: adjust error message

fix #1285

* test: enable tests that work in native-shadow

* test: disable non-composed event tests because of webkit bug

WebKit bug - https://bugs.webkit.org/show_bug.cgi?id=206374

* fix: use regex for error message variants
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

Successfully merging this pull request may close these issues.

Invoking innerHTML or textContent setter should throw an error
2 participants