mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 17:57:36 +08:00
This also helps future work, for example, Computed style grouping, to be TS-componentized as well. Bug: chromium:1106251, chromium:1096230 Change-Id: I2f8a977f4e3f701905354cb4edb15702cb8cd2a3 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336723 Commit-Queue: Changhao Han <changhaohan@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
47 lines
1.2 KiB
HTML
47 lines
1.2 KiB
HTML
<!--
|
|
Copyright 2020 The Chromium Authors. All rights reserved.
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
found in the LICENSE file.
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title>basic Computed Style Trace example</title>
|
|
<style>
|
|
#container {
|
|
width: 80%;
|
|
border: 1px solid black;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
</div>
|
|
|
|
<script type="module">
|
|
import {ComputedStyleTrace} from '../../elements/ComputedStyleTrace.js';
|
|
|
|
const component = new ComputedStyleTrace();
|
|
|
|
const traceValue = document.createElement('span');
|
|
traceValue.textContent = 'block';
|
|
traceValue.slot = 'trace-value';
|
|
component.appendChild(traceValue);
|
|
|
|
const traceLink = document.createElement('span');
|
|
traceLink.textContent = 'user agent stylesheet';
|
|
traceLink.slot = 'trace-link';
|
|
component.appendChild(traceLink);
|
|
|
|
document.getElementById('container').appendChild(component);
|
|
component.data = {
|
|
selector: 'body',
|
|
active: true,
|
|
onNavigateToSource: () => {},
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|