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

XFA - Handle correctly nested containers with lr-tb layout (bug 1718670) #13691

Merged
merged 1 commit into from
Jul 7, 2021

Conversation

calixteman
Copy link
Contributor

@calixteman calixteman commented Jul 7, 2021

  • and avoid to push a field with no dimensions when we have some available space in width in a parent.

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/392ff196b68a244/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/487370c898ba584/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/392ff196b68a244/output.txt

Total script time: 31.97 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 17
  different first/second rendering: 1

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

@marco-c
Copy link
Contributor

marco-c commented Jul 7, 2021

There is a regression in firefox-xfa_issue13500-page2.

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/487370c898ba584/output.txt

Total script time: 36.07 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 21
  different first/second rendering: 1

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

@calixteman
Copy link
Contributor Author

I'm sad here because I'd say that this "yellow pages" on 2 lines is not so bad...
The parent container as a layout lr-tb and the field "yellow..." has no dimensions. And in this case, we have enough space to put the field at the end of the line.

@marco-c
Copy link
Contributor

marco-c commented Jul 7, 2021

I'm OK with accepting the regression, @brendandahl wdyt?

@calixteman
Copy link
Contributor Author

I think it's better to fix: we could have strange things because of that.
My idea is when it's possible always "prefer" a non-broken text.

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/243e169c2dc179f/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/38387c3b1bd87c6/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/243e169c2dc179f/output.txt

Total script time: 31.86 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 17

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

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/38387c3b1bd87c6/output.txt

Total script time: 36.10 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 18

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

src/core/xfa/template.js Outdated Show resolved Hide resolved
src/core/xfa/template.js Outdated Show resolved Hide resolved
src/core/xfa/template.js Outdated Show resolved Hide resolved
  - and avoid to push a field with no dimensions when we have some available space in width in a parent.
@calixteman
Copy link
Contributor Author

/botio makeref

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/69db92dd5b27f90/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Received

Command cmd_makeref from @calixteman received. Current queue size: 1

Live output at: http://3.101.106.178:8877/58f7e48451a05be/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/69db92dd5b27f90/output.txt

Total script time: 28.68 mins

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

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2021

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/58f7e48451a05be/output.txt

Total script time: 33.56 mins

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

}
// Else wait and see: this node will be layed out itself
// in the provided space and maybe a children won't fit.

if (node.w === "" || Math.round(w - space.width) <= ERROR) {
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Jul 8, 2021

Choose a reason for hiding this comment

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

@calixteman It seems that LGTM complains about this line, since w === undefined always holds here; which I'm guessing is probably not what you actually want?

Could we simplify all of the code in the various cases by replacing

let y, w, h;

with unconditionally doing const [, y, w, h] = getTransformedBBox(node); instead?

If so, I can submit a patch to fix that!

Snuffleupagus added a commit to Snuffleupagus/pdf.js that referenced this pull request Jul 10, 2021
… (PR 13691 follow-up)

This way we ensure that these BBox values are *always* defined as expected for every `case`-block, and we also don't need to duplicate the lookup in multiple places. (Also, the patch removes a couple of unnecessary line-breaks in existing comments.)

Fixes mozilla#13691 (review), which was flagged by LGTM.
bh213 pushed a commit to bh213/pdf.js that referenced this pull request Jun 3, 2022
… (PR 13691 follow-up)

This way we ensure that these BBox values are *always* defined as expected for every `case`-block, and we also don't need to duplicate the lookup in multiple places. (Also, the patch removes a couple of unnecessary line-breaks in existing comments.)

Fixes mozilla#13691 (review), which was flagged by LGTM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants