Skip to content

Commit a3a205d

Browse files
authored
Merge pull request #20871 from calixteman/refactor_debugger
Split the new debugger into multiple files
2 parents 315491d + 7bac644 commit a3a205d

19 files changed

Lines changed: 4863 additions & 4155 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ directory `build/chromium`.
4646

4747
### PDF debugger
4848

49-
Browser the internal structure of a PDF document with https://mozilla.github.io/pdf.js/internal-viewer/web/pdf_internal_viewer.html
49+
Browser the internal structure of a PDF document with https://mozilla.github.io/pdf.js/internal-viewer/web/debugger.html
5050

5151
## Getting the Code
5252

gulpfile.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,13 +2372,13 @@ gulp.task("check_l10n", function (done) {
23722372

23732373
function createInternalViewerBundle(defines) {
23742374
const viewerFileConfig = createWebpackConfig(defines, {
2375-
filename: "pdf_internal_viewer.mjs",
2375+
filename: "debugger.mjs",
23762376
library: {
23772377
type: "module",
23782378
},
23792379
});
23802380
return gulp
2381-
.src("./web/pdf_internal_viewer.js", { encoding: false })
2381+
.src("./web/internal/debugger.js", { encoding: false })
23822382
.pipe(webpack2Stream(viewerFileConfig));
23832383
}
23842384

@@ -2389,10 +2389,10 @@ function buildInternalViewer(defines, dir) {
23892389
createMainBundle(defines).pipe(gulp.dest(dir + "build")),
23902390
createWorkerBundle(defines).pipe(gulp.dest(dir + "build")),
23912391
createInternalViewerBundle(defines).pipe(gulp.dest(dir + "web")),
2392-
preprocessHTML("web/pdf_internal_viewer.html", defines).pipe(
2392+
preprocessHTML("web/internal/debugger.html", defines).pipe(
23932393
gulp.dest(dir + "web")
23942394
),
2395-
preprocessCSS("web/pdf_internal_viewer.css", defines)
2395+
preprocessCSS("web/internal/debugger.css", defines)
23962396
.pipe(
23972397
postcss([
23982398
postcssDirPseudoClass(),
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* Copyright 2026 Mozilla Foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
.gfx-state-section {
17+
padding-inline: 12px;
18+
}
19+
20+
.gfx-state-section + .gfx-state-section {
21+
margin-top: 8px;
22+
padding-top: 8px;
23+
border-top: 1px solid var(--border-color);
24+
}
25+
26+
.gfx-state-title {
27+
display: flex;
28+
align-items: center;
29+
justify-content: space-between;
30+
gap: 4px;
31+
color: var(--accent-color);
32+
font-weight: bold;
33+
margin-bottom: 4px;
34+
}
35+
36+
.gfx-state-stack-nav {
37+
display: flex;
38+
align-items: center;
39+
gap: 2px;
40+
font-weight: normal;
41+
font-size: 0.8em;
42+
}
43+
44+
.gfx-state-stack-button {
45+
padding: 0 3px;
46+
border: 1px solid currentcolor;
47+
border-radius: 2px;
48+
background: transparent;
49+
color: inherit;
50+
cursor: pointer;
51+
line-height: 1.3;
52+
53+
&:disabled {
54+
cursor: default;
55+
opacity: 0.35;
56+
}
57+
}
58+
59+
.gfx-state-stack-pos {
60+
min-width: 4ch;
61+
text-align: center;
62+
font-variant-numeric: tabular-nums;
63+
}
64+
65+
.gfx-state-row {
66+
display: flex;
67+
align-items: center;
68+
gap: 8px;
69+
padding: 1px 0;
70+
}
71+
72+
.gfx-state-key {
73+
color: var(--muted-color);
74+
flex-shrink: 0;
75+
min-width: 20ch;
76+
}
77+
78+
.gfx-state-val {
79+
color: var(--number-color);
80+
flex: 1 1 0;
81+
min-width: 0;
82+
overflow: hidden;
83+
text-overflow: ellipsis;
84+
white-space: nowrap;
85+
}

0 commit comments

Comments
 (0)