CompareDocumentPositionCase() — react Function Reference
Architecture documentation for the CompareDocumentPositionCase() function in CompareDocumentPositionCase.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 3f57495b_14dc_06ac_3f56_2fe15710411c["CompareDocumentPositionCase()"] a9262b9a_dffc_fb68_c0ef_7ba585994573["CompareDocumentPositionCase.js"] 3f57495b_14dc_06ac_3f56_2fe15710411c -->|defined in| a9262b9a_dffc_fb68_c0ef_7ba585994573 style 3f57495b_14dc_06ac_3f56_2fe15710411c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
fixtures/dom/src/components/fixtures/fragment-refs/CompareDocumentPositionCase.js lines 7–53
export default function CompareDocumentPositionCase() {
return (
<TestCase title="compareDocumentPosition">
<TestCase.Steps>
<li>Click the "Compare All Positions" button</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The compareDocumentPosition method compares the position of the fragment
relative to other elements in the DOM. The "Before Element" should be
PRECEDING the fragment, and the "After Element" should be FOLLOWING.
Elements inside the fragment should be CONTAINED_BY.
</TestCase.ExpectedResult>
<Fixture>
<Fixture.Controls>
<CompareDocumentPositionFragmentContainer>
<div
style={{
padding: '10px',
backgroundColor: 'lightblue',
borderRadius: '4px',
marginBottom: '8px',
}}>
First child element
</div>
<div
style={{
padding: '10px',
backgroundColor: 'lightgreen',
borderRadius: '4px',
marginBottom: '8px',
}}>
Second child element
</div>
<div
style={{
padding: '10px',
backgroundColor: 'lightpink',
borderRadius: '4px',
}}>
Third child element
</div>
</CompareDocumentPositionFragmentContainer>
</Fixture.Controls>
</Fixture>
</TestCase>
);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does CompareDocumentPositionCase() do?
CompareDocumentPositionCase() is a function in the react codebase, defined in fixtures/dom/src/components/fixtures/fragment-refs/CompareDocumentPositionCase.js.
Where is CompareDocumentPositionCase() defined?
CompareDocumentPositionCase() is defined in fixtures/dom/src/components/fixtures/fragment-refs/CompareDocumentPositionCase.js at line 7.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free