mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +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>
52 lines
1.4 KiB
HTML
52 lines
1.4 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>traceable Computed Style Property example</title>
|
|
<style>
|
|
#container {
|
|
width: 80%;
|
|
border: 1px solid black;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
</div>
|
|
|
|
<script type="module">
|
|
import {ComputedStyleProperty} from '../../elements/ComputedStyleProperty.js';
|
|
|
|
const component = new ComputedStyleProperty();
|
|
|
|
const propertyName = document.createElement('span');
|
|
propertyName.textContent = 'display';
|
|
propertyName.slot = 'property-name';
|
|
component.appendChild(propertyName);
|
|
|
|
const propertyValue = document.createElement('span');
|
|
propertyValue.textContent = 'grid';
|
|
propertyValue.slot = 'property-value';
|
|
component.appendChild(propertyValue);
|
|
|
|
const trace = document.createElement('pre');
|
|
trace.textContent = `block body (style.css):42`;
|
|
trace.slot = 'property-traces';
|
|
component.appendChild(trace);
|
|
|
|
document.getElementById('container').appendChild(component);
|
|
component.data = {
|
|
inherited: false,
|
|
expanded: false,
|
|
onNavigateToSource: () => {},
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|