-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JS] Hide field borders and buttons (#15053) #15054
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -527,3 +527,4 @@ | |
!issue14705.pdf | ||
!bug1771477.pdf | ||
!bug1724918.pdf | ||
!issue15053.pdf |
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary, since all containers already provide that information in a
data-annotation-id
attribute and I cannot immediately tell where in this patch (or the tests) this is even being used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We "need" it here:
pdf.js/web/pdf_scripting_manager.js
Line 354 in b9f5a70
Most of (all?) the actions have an impact on the field's HTML counterpart (e.g. textarea/input for a text field) so it's why I originally decided to use the
id
: my idea was to directly have the element which will receive the change.And I think it wasn't so bad.
I added the
id
on thea
just to be consistent with what we've for other containers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the potentially annoying part of adding
id
s to these elements is that they become "linkable" through the URL hash in a way that's not supported/intended (see issue #11499 and PR #11503 for some context).These
id
s could potentially clash with named destinations, and by adding this to all link elements these issues could very well become more common. I wonder if there's a better way, in general for all annotations, to handle things rather than usingid
s like this!?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least from a JS pov, I think we can get rid of it easily: we could select the
section
with the correctdata-annotation-id
which will itself update the correct child.I wonder if it could have a measurable impact on perf: query selector vs getElementById and then go to the child...
Anyway I played
/f1040.pdf#208R
(an annotation on the bottom of page 2) and the form is scrolled...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My gut feeling is that query-selector probably is slower in general :-(
Although we're already using that in some parts of the AnnotationLayer-code, see
pdf.js/src/display/annotation_layer.js
Lines 2506 to 2508 in b9f5a70
pdf.js/src/display/annotation_layer.js
Line 2553 in b9f5a70
Which it obviously shouldn't :-)
As mentioned that may cause some trouble if the document has a "named destination" which happens to be called 208R.
Anyway, we obviously don't have to try and fix all of that right now here in this patch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed a bug:
#15056