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

Move text layer UI to viewer.js... #954

Merged
merged 5 commits into from
Jan 4, 2012

Conversation

notmasteryet
Copy link
Contributor

also fixes adding div with single char and replaces innerHTML to textContent

@notmasteryet
Copy link
Contributor Author

@pdfjsbot test

@pdfjsbot
Copy link

Processing command test by user notmasteryet. Queue size: 0

Live script output is available (after queueing is done) at: http://184.73.87.52:8989/3197309.txt

[bot:processed:3197309]

@pdfjsbot
Copy link

ERROR(s) found

ATTENTION: There was a snapshot difference:
http://184.73.87.52:8989/tests/a52aacab5a8925350e3208a575080f243ff48ccf/reftest-analyzer.xhtml#web=/tests/a52aacab5a8925350e3208a575080f243ff48ccf/eq.log

Output:

========== Killing any stray processes

========== Running garbage collector in /home/ubuntu/pdf.js-bot/tmp
Collecting garbage...

========== Cloning pull request repo
Cloning into ....

========== Merging upstream into pull request clone

========== Running 'make lint'
gjslint --nojsdoc  src/canvas.js src/charsets.js src/cidmaps.js src/colorspace.js src/core.js src/crypto.js src/evaluator.js src/fonts.js src/function.js src/glyphlist.js src/image.js src/metrics.js src/obj.js src/parser.js src/pattern.js src/pdf.js src/stream.js src/util.js src/worker.js src/worker_loader.js  web/compatibility.js web/viewer.js test/driver.js examples/helloworld/hello.js extensions/firefox/bootstrap.js extensions/firefox/components/pdfContentHandler.js 
26 files checked, no errors found.

========== Cloning reference images repo into test/ref/
Initialized empty Git repository in /home/ubuntu/pdf.js-bot/tmp/tests/a52aacab5a8925350e3208a575080f243ff48ccf/test/ref/.git/

========== Checking for consistency with reference repo

========== Running 'make bot_test'
Xvfb: no process found
cd test; \
    python -u test.py \
    --browserManifestFile=resources/browser_manifests/browser_manifest.json \
    --manifestFile=test_manifest.json
Launching firefox
Launching chrome
TEST-PASS | eq test tracemonkey-eq | in chrome
TEST-PASS | eq test tracemonkey-eq | in firefox
TEST-PASS | forward-back-forward test tracemonkey-fbf | in chrome
TEST-PASS | load test html5-canvas-cheat-sheet-load | in chrome
TEST-PASS | forward-back-forward test tracemonkey-fbf | in firefox
TEST-PASS | load test html5-canvas-cheat-sheet-load | in firefox
TEST-PASS | load test intelisa-load | in chrome
TEST-PASS | load test intelisa-load | in firefox
TEST-PASS | load test pdfspec-load | in chrome
TEST-PASS | load test shavian-load | in chrome
TEST-PASS | eq test sizes | in chrome
TEST-PASS | eq test plusminus | in chrome
TEST-PASS | load test openoffice-pdf | in chrome
TEST-PASS | load test openofficecidtruetype-pdf | in chrome
TEST-PASS | load test openofficearabiccidtruetype-pdf | in chrome
TEST-PASS | load test arabiccidtruetype-pdf | in chrome
TEST-PASS | load test complexttffont-pdf | in chrome
TEST-PASS | eq test thuluthfont-pdf | in chrome
TEST-PASS | eq test freeculture | in chrome
TEST-PASS | eq test wnv_chinese-pdf | in chrome
TEST-PASS | eq test i9-pdf | in chrome
TEST-PASS | load test hmm-pdf | in chrome
TEST-PASS | eq test rotation | in chrome
TEST-PASS | load test ecma262-pdf | in chrome
TEST-PASS | load test jai-pdf | in chrome
TEST-PASS | eq test cable | in chrome
TEST-UNEXPECTED-FAIL | eq pdkids | in chrome | rendering of page 9 != reference rendering
TEST-PASS | eq test artofwar | in chrome
TEST-PASS | eq test wdsg_fitc | in chrome
TEST-PASS | eq test unix01 | in chrome
TEST-PASS | eq test fit11-talk | in chrome
TEST-PASS | eq test fips197 | in chrome
TEST-PASS | load test txt2pdf | in chrome
TEST-PASS | load test f1040 | in chrome
TEST-PASS | load test hudsonsurvey | in chrome
TEST-PASS | eq test extgstate | in chrome
TEST-PASS | eq test usmanm-bad | in chrome
TEST-PASS | load test vesta-bad | in chrome
TEST-PASS | load test scan-bad | in chrome
TEST-PASS | load test ibwa-bad | in chrome
TEST-PASS | eq test tcpdf_033 | in chrome
TEST-PASS | eq test pal-o47 | in chrome
TEST-PASS | eq test simpletype3font | in chrome
TEST-PASS | eq test close-path-bug | in chrome
TEST-PASS | eq test alphatrans | in chrome
TEST-PASS | eq test devicen | in chrome
TEST-PASS | eq test cmykjpeg | in chrome
TEST-PASS | eq test protectip | in chrome
TEST-PASS | eq test piperine | in chrome
TEST-PASS | eq test issue840 | in chrome
TEST-PASS | eq test bpl13210 | in chrome
TEST-PASS | eq test tutorial | in chrome
TEST-PASS | eq test geothermal.pdf | in chrome
TEST-PASS | eq test lista_preliminar | in chrome
TEST-PASS | eq test issue919 | in chrome
TEST-PASS | eq test issue918 | in chrome
TEST-PASS | eq test aboutstacks | in chrome
TEST-PASS | load test pdfspec-load | in firefox
TEST-PASS | load test shavian-load | in firefox
TEST-PASS | eq test sizes | in firefox
TEST-PASS | eq test plusminus | in firefox
TEST-PASS | load test openoffice-pdf | in firefox
TEST-PASS | load test openofficecidtruetype-pdf | in firefox
TEST-PASS | load test openofficearabiccidtruetype-pdf | in firefox
TEST-PASS | load test arabiccidtruetype-pdf | in firefox
TEST-PASS | load test complexttffont-pdf | in firefox
TEST-PASS | eq test thuluthfont-pdf | in firefox
TEST-PASS | eq test freeculture | in firefox
TEST-PASS | eq test wnv_chinese-pdf | in firefox
TEST-PASS | eq test i9-pdf | in firefox
TEST-PASS | load test hmm-pdf | in firefox
TEST-PASS | eq test rotation | in firefox
TEST-PASS | load test ecma262-pdf | in firefox
TEST-PASS | load test jai-pdf | in firefox
TEST-PASS | eq test cable | in firefox
TEST-UNEXPECTED-FAIL | eq pdkids | in firefox | rendering of page 9 != reference rendering
TEST-PASS | eq test artofwar | in firefox
TEST-PASS | eq test wdsg_fitc | in firefox
TEST-PASS | eq test unix01 | in firefox
TEST-PASS | eq test fit11-talk | in firefox
TEST-PASS | eq test fips197 | in firefox
TEST-PASS | load test txt2pdf | in firefox
TEST-PASS | load test f1040 | in firefox
TEST-PASS | load test hudsonsurvey | in firefox
TEST-PASS | eq test extgstate | in firefox
TEST-PASS | eq test usmanm-bad | in firefox
TEST-PASS | load test vesta-bad | in firefox
TEST-PASS | load test scan-bad | in firefox
TEST-PASS | load test ibwa-bad | in firefox
TEST-PASS | eq test tcpdf_033 | in firefox
TEST-PASS | eq test pal-o47 | in firefox
TEST-PASS | eq test simpletype3font | in firefox
TEST-PASS | eq test close-path-bug | in firefox
TEST-PASS | eq test alphatrans | in firefox
TEST-PASS | eq test devicen | in firefox
TEST-PASS | eq test cmykjpeg | in firefox
TEST-PASS | eq test protectip | in firefox
TEST-PASS | eq test piperine | in firefox
TEST-PASS | eq test issue840 | in firefox
TEST-PASS | eq test bpl13210 | in firefox
TEST-PASS | eq test tutorial | in firefox
TEST-PASS | eq test geothermal.pdf | in firefox
TEST-PASS | eq test lista_preliminar | in firefox
TEST-PASS | eq test issue919 | in firefox
TEST-PASS | eq test issue918 | in firefox
TEST-PASS | eq test aboutstacks | in firefox

OHNOES!  Some tests failed!
  different ref/snapshot: 2
Process firefox is still running. Killing.
Runtime was 1703 seconds
./run-test: line 195:  7815 Killed                  Xvfb :1 -screen 0 1280x1024x24 > /dev/null 2> /dev/null

========== Cleaning up

All done.


_____________________________ stderr:

Bot response time: 29.41 mins

@notmasteryet
Copy link
Contributor Author

reference images were not updated for #947

@jviereck
Copy link
Contributor

The patch looks good, thanks Yury!

Should the code for the TextLayerBuilder be located inside the viewer.js or in one of the "core" js files of PDF.JS, like the canvas.js file itself? That way, if someone what's to use the PDF.JS library to render a page, he can do this without looking at the viewer.js file. If we move the TextLayerBuilder code into the canvas.js file, we could also update the example on how to add text selection.

/cc @arturadib as he is Mr. Text Selection.

@arturadib
Copy link
Contributor

Great factoring work, Yury. However the text layer seems to be rendering all messed up here (you can change to color:blue in viewer.css : .textLayer > div to see this).

Should the code for the TextLayerBuilder be located inside the viewer.js or in one of the "core" js files of PDF.JS, like the canvas.js file itself?

Yes, I agree Julian, but we seem to be divided about this :) Yury seems to prefer for this to be a viewer feature, like annotations.

I actually prefer for both text selection and annotations to be in src/ -- in my mind, they're rendering backends just like canvas.js, and will probably be useful for other folks who are building apps and who don't necessarily want to understand our web viewer code. Perhaps textlayer.js and annotations.js ?

But that's not urgent, and can be part of perhaps a future effort to revisit what we want to offer with our API.

@jviereck
Copy link
Contributor

I actually prefer for both text selection and annotations to be in src/ -- in my mind, they're rendering backends just like canvas.js, and will probably be useful for other folks who are building apps and who don't necessarily want to understand our web viewer code. Perhaps textlayer.js and annotations.js ?

But that's not urgent, and can be part of perhaps a future effort to revisit what we want to offer with our API.

Do you think it's worth discussing this during the Thursday call? /cc @wfwalker

There might be also a middle way for this: We can place it under src/ or somewhere else but don't build it into the PDF.JS library. However, as it's not included in the viewer.js file, it should be more simple to reuse it if you want to, but you don't have to include the code if you just want to get the "pure" PDF renderer.

@notmasteryet
Copy link
Contributor Author

@arturadib, the layout issue is fixed.

The TextLayerBuilder is about 50 lines and will not get much bigger. I don't think it worth to create separate file for this. Same, I think, will happen with annotations (see setupAnnotations). It does not make sense to create something like viewerutils.js (in src/ or web/) either.

@arturadib
Copy link
Contributor

Git-rotten.

We can merge this and decide on where to place annotations + text layer when we revisit our API, hopefully this quarter.

EDIT: I still want to play with the text selection here before +1'ing...

@notmasteryet
Copy link
Contributor Author

the master merged... again :)

@arturadib
Copy link
Contributor

Interesting, this seems to fix #924... must be related to the append order.

@arturadib
Copy link
Contributor

As I said, we'll probably have to revisit this for the new API, but it's nice to have the code factored out of canvas.js -- it will help.

arturadib added a commit that referenced this pull request Jan 4, 2012
Move text layer UI to viewer.js...
@arturadib arturadib merged commit 07deee5 into mozilla:master Jan 4, 2012
@notmasteryet notmasteryet deleted the textlayout-ui branch February 18, 2014 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants