Skip to content
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

Fix popup for highlights without popup (follow-up of #12505) #12585

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

calixteman
Copy link
Contributor

@calixteman calixteman commented Nov 5, 2020

Fixes #12576.

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2020

From: Bot.io (Linux m4)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://54.67.70.0:8877/4e0cb532ab3a25f/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2020

From: Bot.io (Windows)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://3.101.106.178:8877/d1c35a04be45b0b/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2020

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/4e0cb532ab3a25f/output.txt

Total script time: 24.87 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/4e0cb532ab3a25f/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2020

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/d1c35a04be45b0b/output.txt

Total script time: 27.92 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/d1c35a04be45b0b/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with these comments addressed.

@@ -262,7 +262,9 @@ class AnnotationElement {
quadPoint[1].y,
];
this.data.rect = rect;
quadrilaterals.push(this._createContainer(ignoreBorder));
const quad = this._createContainer(ignoreBorder);
quad.className = "highlightAnnotation";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _createQuadrilaterals method is generic since multiple annotation types can use quadrilaterals, so this class name should not be set here. Fortunately, it can simply be fixed locally in the HighlightAnnotationElement class below.

Hence I'd suggest to revert all changes in this method and instead simply change the render method in the HighlightAnntationElement class to the following (untested):

  render() {
    if (!this.data.hasPopup) {
      this._createPopup(null, this.data);
    }

    if (this.quadrilaterals) {
      this.quadrilaterals.forEach(quadrilateral => {
        quadrilateral.className = "highlightAnnotation";
      });
      return this.quadrilaterals;
    }

    this.container.className = "highlightAnnotation";
    return this.container;
  }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calixteman Hm, it looks like this comment was forgotten to be addressed. Would you mind following this up in a new PR to move this specific class name setting out of the generic function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry misread the comment, thought it had been addressed. Filed #12585

src/display/annotation_layer.js Outdated Show resolved Hide resolved
src/display/annotation_layer.js Outdated Show resolved Hide resolved
@Snuffleupagus
Copy link
Collaborator

Given that this fixes a regression, we probably want to make sure this lands before the next "Merge Date" (which according to https://wiki.mozilla.org/Release_Management/Calendar is in less than one week); @calixteman Do you have time to address the outstanding comments here?

 * remove 1st param of _createPopup (almost useless for a method)
 * prepend popup div to avoid to have them on top of some highlights (and so "disable" partially mouse events)
 * add a ref test for issue mozilla#12504
@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://54.67.70.0:8877/264635770c21fb2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://3.101.106.178:8877/c12239905607351/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/264635770c21fb2/output.txt

Total script time: 24.86 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/264635770c21fb2/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/c12239905607351/output.txt

Total script time: 27.69 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/c12239905607351/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://54.67.70.0:8877/e101f4cf9759cb0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://3.101.106.178:8877/2c001703aad5ef3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/e101f4cf9759cb0/output.txt

Total script time: 24.00 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/2c001703aad5ef3/output.txt

Total script time: 29.37 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@brendandahl brendandahl merged commit 85de01e into mozilla:master Nov 10, 2020
calixteman added a commit to calixteman/pdf.js that referenced this pull request Nov 14, 2020
timvandermeij added a commit that referenced this pull request Nov 14, 2020
Follow-up for #12585: set elements class in render instead of in _createQuadrilaterals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix highlight annotation regressions
5 participants