-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(engine): removal of is attr and forceTagName
* refactor(engine): removal of is attr and forceTagName * fix(engine): removing integration test for forceTagName * fix: remove custom element transformation from CSS (#695) * fix(compiler): fixing fixtures * refactor(engine): snabbdom lite - phase 1 (#606) * refactor(engine): removal of is attr and forceTagName * refactor(engine): removal of is attr and forceTagName * fix(engine): removing integration test for forceTagName * refactor(engine): snabbdom lite - phase 1 * refactor(engine): adding hooks.ts * refactor(engine): removing global hooks * refactor(engine): splitting style and class modules into static and dynamic * test(engine): ready for the final push * refactor(engine): making hooks mandatory. * refactor(engine): making all hooks functions * refactor(engine): dynamic diff vs static diff * refactor(engine): using two diff algos * refactor(engine): removing htmlapi in favor of pure patching * fix(engine): missing argument when determining diff algo * fix(engine): adding tests for dynamic diff * fix(engine): clean up * fix(engine): integration test failures * refactor(engine): proto chaining * fix(engine): wrong auto import * fix(engine): correcting the proto chain * refactor(engine): implementing the base element proto chain * test(engine): adding more tests for restrictions on elements * refactor(engine): rename to BaseBridgeElement * feat(engine): dom patching (#688) * feat(engine): dom patching * fix(engine): cleanup descriptors * feat(engine): rebase * fix(engine): linting * fix(engine): pr feedback * fix(engine): lint * fix(compiler): updated snapshot testing to account for shadow dom * fix(engine): pr feedback * fix(engine): fixing restrictions on custom elements * fix(engine): exposing host (#705) * fix(engine): exposing host * fix(engine): shadow root * wip(engine): linting and type errors * fix(engine): cleaning up shadow root detection * fix(engine): removing restrictions test * fix(engine): fixing element from point methods * fix(engine): disabling some attribute integration test for now * fix(engine): linting * fix(engine): upgrade ie11 driver * fix(engine): compat test fix * fix(engine): applying elementFromPoint on document * fix(engine): linting * fix(engine): reverting unnecessary changes * fix(engine): removing skip in test * fix(engine): polyfill readmes * fix(engine): review feedback * fix(engine): integration tests for elementFromPoint * fix(engine): ie11 elementsFromPoint * fix(engine): feedback * fix(engine): ts fix * wip: yarn update * fix(engine): fixing snapshot test wip: styles still broken wip: fix styles
- Loading branch information
Showing
11 changed files
with
61 additions
and
222 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/lwc-compiler/src/__tests__/fixtures/expected-minify-no-comments.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/lwc-compiler/src/__tests__/fixtures/expected-styled-prod.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/lwc-engine/src/polyfills/document-element-from-point/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# document.elementFromPoint polyfill | ||
|
||
This polyfill is needed to make `document.elementFromPoint` aware of our synthetic shadow roots. | ||
|
||
- Polyfill will only return root nodes from LWC trees | ||
- Polyfill works correctly in both Synthetic and Native Shadow Dom modes |
3 changes: 3 additions & 0 deletions
3
packages/lwc-engine/src/polyfills/document-element-from-point/detect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function detect(): boolean { | ||
return true; | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/lwc-engine/src/polyfills/document-element-from-point/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import detect from './detect'; | ||
import apply from './polyfill'; | ||
|
||
if (detect()) { | ||
apply(); | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/lwc-engine/src/polyfills/document-element-from-point/polyfill.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { elementsFromPoint } from "../../faux-shadow/document"; | ||
import { getNodeOwnerKey } from "../../framework/vm"; | ||
import { isUndefined } from "../../shared/language"; | ||
|
||
export default function apply() { | ||
function elemFromPoint(left: number, top: number): Element | null { | ||
const elements = elementsFromPoint.call(document, left, top); | ||
const { length } = elements; | ||
let match = null; | ||
for (let i = length - 1; i >= 0; i -= 1) { | ||
const el = elements[i]; | ||
const ownerKey = getNodeOwnerKey(el); | ||
if (isUndefined(ownerKey)) { | ||
match = elements[i]; | ||
} | ||
} | ||
return match; | ||
} | ||
|
||
// https://github.com/Microsoft/TypeScript/issues/14139 | ||
document.elementFromPoint = elemFromPoint as (left: number, top: number) => Element; | ||
} |