Commit Graph

617 Commits (aaca7774c9d43243bc0f7c9a2a2ae38ae2b8f251)

Author SHA1 Message Date
Oleg Pudeyev 26e51f4b8a -ldl is needed only on Linux, not on all Unices.
In particular on FreeBSD there is no -ldl as the respective
functionality is in -lc.

http://code.google.com/p/phantomjs/issues/detail?id=597
2013-01-09 00:07:36 -08:00
Oleg Pudeyev 52e67c5aa7 Use bash from PATH rather than hardcoded in /bin.
E.g. FreeBSD has bash in /usr/local.

http://code.google.com/p/phantomjs/issues/detail?id=597
2013-01-09 00:06:58 -08:00
Vitaliy Slobodin 09e929d599 Allow to abort network requests.
Issue: http://code.google.com/p/phantomjs/issues/detail?id=230
2013-01-04 23:39:23 -08:00
Vitaliy Slobodin fd700b0702 New WebPage callback: onResourceError.
This callback is invoked when the WebPage was unable to request the resource

Issue: http://code.google.com/p/phantomjs/issues/detail?id=954
2013-01-04 21:24:30 -08:00
execjosh d906bc3819 Automate lazy generation of REPL completion lists
All invokable methods, slots, signals, and properties visible from
JavaScript, but which do not start with an underscore, are lazily
(only when necessary) added to the completion list through dynamic
reflection.

This leverages `QMetaObject` for reflection of `QObject`s.  As such,
there is now no need to inherit `REPLCompletable` and it has been
removed.

http://code.google.com/p/phantomjs/issues/detail?id=943
2013-01-04 21:23:58 -08:00
Ariya Hidayat d0fe6864a9 Mac OS X: Fix possible crash when using some TrueType fonts.
This is just a workaround. We simply avoid removing the custom font
(intentionally leak it, a small price to pay) because otherwise it will
invalidate Qt's font cache, which in turns trigger the crash at
CoreText's CTFontCopyGraphicsFont.

http://code.google.com/p/phantomjs/issues/detail?id=690
2012-12-30 21:17:40 -08:00
execjosh f52044cd31 Emulate spawn and execFile from node.js's child_process module
This is a rudimentary implementation of the following methods
from [node.js's `child_process` module][1]:

 *  `spawn`
 *  `execFile`

The examples are relevant only for *nix operating systems...

The following methods are Not Yet Implemented™:

 *  `exec`
 *  `fork`

[1]: http://nodejs.org/docs/v0.8.16/api/child_process.html

http://code.google.com/p/phantomjs/issues/detail?id=219
2012-12-29 01:03:08 +09:00
execjosh 836719f72e Implement CommonJS IO/A read([n Number])
The [IO/A spec][1] for `read` is as follows:

> Read up to n bytes from the stream, or until the end of the stream
> has been reached. [If] n is null, reads up to the block size of the
> underlying device, or up to 1024 bytes if the block size is not
> discernible. If n is not specified, this method always reads the
> full stream until its end is reached. ...

Since discovering the block size of the underlying device is
non-trivial, we will just default to 1024.

**NOTE**

The initial implementation of `File::read()` saves the current
(original) position, seeks to the beginning of the stream,
`readAll`s to the end, and then resets to the original position.

  I think that this behavior is unexpected and should be changed--it
should read from the current position to the end of the stream and
stay there.  The user should explicitly `seek` to the beginning of
the stream when necessary.

  With the current implementation, the user should note that the
position *will not change* after calling `read()` with no arguments.

[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods

http://code.google.com/p/phantomjs/issues/detail?id=938
2012-12-25 20:46:14 -08:00
execjosh 6bc3a93118 Add `seek` method to `File` class
This method is necessary for random-access streams.  It will also be
helpful in the future when implementing the [IO/A spec][1].

[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods

http://code.google.com/p/phantomjs/issues/detail?id=937
2012-12-25 13:11:20 -08:00
execjosh f6c87221a7 Implement system.std{in,out,err}
See [issue 333][1] and pull request #192.

**Caveat**

`File::read` currently takes no parameters and is equivalent to a
"`readAll`".  This will be changed later to match [IO/A Spec's
`Stream#read`][2]; but, should still be noted.

[1]: http://code.google.com/p/phantomjs/issues/detail?id=333
[2]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods
2012-12-25 03:41:34 -08:00
Ariya Hidayat 3f42fb230f Linux: Ensure we use 72 dpi.
For our QPA/Lighthouse platform screen, apparently we need to specify the
physical screen size because otherwise the default 100 dpi will be used.

This also brings font rendering on headless Linux to 72 dpi.

http://code.google.com/p/phantomjs/issues/detail?id=659
2012-12-23 12:03:10 -08:00
Ariya Hidayat fac15407e8 Call the development branch as version 1.9. 2012-12-23 08:57:37 -08:00
execjosh 03500e6b55 Implement fs.{split(path),join(...),{to,from}NativeSeparators}
For fs.{split,join} specs, see: http://wiki.commonjs.org/wiki/Filesystem/A#Paths_as_Text

http://code.google.com/p/phantomjs/issues/detail?id=361
2012-12-22 23:05:46 -08:00
Ivan De Marino d998c59358 Importing GhostDriver v1.0.2.
Changes listed here: https://github.com/detro/ghostdriver/issues?labels=1.0.2&page=1&state=closed
2012-12-19 19:29:54 -08:00
Ariya Hidayat 8836398825 Generalize WebServer binary data handling into a real encoding support.
http://code.google.com/p/phantomjs/issues/detail?id=505
2012-12-17 23:12:48 -08:00
Sebastian Krzyszkowiak 78e72312dc Implement WebServerResponse::setEncoding in order to allow binary encoding to be sent.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=505
2012-12-17 19:27:06 -08:00
Ivan De Marino 302050e0ce Fixing typo in GhostDriver 1.0.1 2012-12-17 19:15:43 -08:00
David Burrows 15fe514025 Increase maximum number of redirects in line with modern browsers.
Modern browser mostly limit re-directs to 20. The current limit in  PhantomJS is 10 which is not in line with most browsers. This patch is a simple increase of gMaxRedirections from 10 to 20.

http://code.google.com/p/phantomjs/issues/detail?id=849
2012-12-16 22:21:07 -08:00
qubird f6a91a8813 New WebPage#setContent api - makes possible to specify location along with content
http://code.google.com/p/phantomjs/issues/detail?id=909
2012-12-16 15:43:10 -08:00
Ivan De Marino 027aa93b18 Importing GhostDriver version `1.0.1`.
Changes are documented here:
https://github.com/detro/ghostdriver/issues?labels=1.0.1&state=closed.

https://github.com/detro/ghostdriver/issues/130
2012-12-16 13:55:58 -08:00
Ivan De Marino f5652e5110 Fix "--webdriver-selenium-grid-hub" CLI parameter.
I had forgotten to update the option parsing code,
and the option was never picked.

Related issue: [GhostDriver #130](https://github.com/detro/ghostdriver/issues/130).
2012-12-13 23:45:54 -08:00
Vitaliy Slobodin 04b74f99fd Enable WOFF file support.
Background:
WOFF format requires that WebKit should be compiled with zlib.

Related issues:
http://code.google.com/p/phantomjs/issues/detail?id=592
2012-12-12 21:42:58 -08:00
Jon Leighton eb3c9caa6e Upgrade to Qt 4.8.4
http://code.google.com/p/phantomjs/issues/detail?id=918
2012-12-12 21:42:45 -08:00
Jon Leighton 66ab9a1113 Fix memory leak on linux
We were previously adding the certificates on each instantiation of
NetworkAccessManager, causing memory consumption to grow unbounded.

I have also removed the Qt version check. It's unnecessary as we only
build against a fixed Qt version.

https://code.google.com/p/phantomjs/issues/detail?id=882
2012-12-12 21:25:26 -08:00
Vitaliy Slobodin 5eb0f64e6b Fix window.location.
Description:
Web Page can't navigate to a relative url using the property 'window.location'.

Upstream bug:
https://bugs.webkit.org/show_bug.cgi?id=47978

Issues:
http://code.google.com/p/phantomjs/issues/detail?id=632
http://code.google.com/p/phantomjs/issues/detail?id=530
2012-12-12 17:03:37 +04:00
James M. Greene 31dd714a22 Added getters for the WebPage#onError and phantom.onError properties
Fixes http://code.google.com/p/phantomjs/issues/detail?id=910
2012-12-11 21:57:25 -08:00
Jon Leighton 487fbf3035 Enable multiple files to be uploaded to a file input
Obviously, the input must have the multiple attribute for this to work.

The API is:

    page.uploadFile('#file_input', ['file1', file2'])

I haven't implemented support for multiple files in the page.filePicker
API because I couldn't work out how to get a return value of an array
of strings through the JS/C++ bridge.

https://code.google.com/p/phantomjs/issues/detail?id=256
2012-12-11 21:41:02 -08:00
James M. Greene c9f9b5a14b Added getters for all of the WebPage signal//callback handlers.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=899
2012-12-05 23:43:50 -06:00
Milian Wolff fd653fe61f Properly use bottom margin to calculate the footer height.
http://code.google.com/p/phantomjs/issues/detail?id=894
2012-11-29 13:42:18 +01:00
Ivan De Marino 4caa71a6b7 Importing latest GhostDriver, tag "1.0.0".
http://code.google.com/p/phantomjs/issues/detail?id=49
2012-11-27 08:00:45 -08:00
Ivan De Marino ffa9fab316 Embedding GhostDriver into PhantomJS(!!!)
Finally. After so much work, this is finally a reality.
To launch PhantomJS in "Remote WebDriver mode":

```bash
$ phantomjs --webdriver=OPTIONAL_IP:OPTIONAL_PORT
```

Also, GhostDriver brings along support for Selenium Grid: now PhantomJS can register itself to a Selenium Grid HUB.
Just launch it in Webdriver Mode with the following extra options:
```bash
$ phantomjs --webdriver=OPTIONAL_IP:OPTIONAL_PORT --webdriver-selenium-grid-hub=http://url.to.selenium.grid.hub:port
```

http://code.google.com/p/phantomjs/issues/detail?id=49
2012-11-27 07:58:34 -08:00
Ivan De Marino 2dcccc8968 First import of `ghostdriver.qrc` & related files.
http://code.google.com/p/phantomjs/issues/detail?id=49
2012-11-27 07:58:13 -08:00
Vitaliy Slobodin 63dd36205f Don't perform on-demand loading of root certificates on Linux
Description:
Qt is performing loading on-demand of root certificates on Linux, which causing SSL errors.

Issue:
http://code.google.com/p/phantomjs/issues/detail?id=882
2012-11-24 16:41:03 +04:00
Milian Wolff 2d778f687e Repeat thead and tfoot when table contains page breaks.
This was already done in https://github.com/ariya/phantomjs/pull/211
but somehow got lost when the Qt source tree was imported.

Note that I even improved this patch a bit to also properly repaint
the borders of cells in thead/tfoot.

http://code.google.com/p/phantomjs/issues/detail?id=615
2012-11-22 15:39:07 +01:00
Milian Wolff 5c87852c32 Prevent page breaks in table rows.
This was part of a previous PhantomJS release but got reverted
when the Qt source tree was imported. See the old pull request
here: https://github.com/ariya/phantomjs/pull/211

http://code.google.com/p/phantomjs/issues/detail?id=880
2012-11-22 15:38:58 +01:00
Ivan De Marino 9ba13ba989 Implementing "goBack", "goForward" and "go".
Completing work for [Issue #808](http://code.google.com/p/phantomjs/issues/detail?id=808).
2012-11-18 16:11:25 -08:00
Vitaliy Slobodin 40a14b72b1 Restore dirty line logic in RenderInline::destroy.
WebKit upstream fix: http://trac.webkit.org/changeset/86060
WebKit upsteam bug: https://bugs.webkit.org/show_bug.cgi?id=60448

Related issues:
http://code.google.com/p/phantomjs/issues/detail?id=704
http://code.google.com/p/phantomjs/issues/detail?id=703
http://code.google.com/p/phantomjs/issues/detail?id=675
http://code.google.com/p/phantomjs/issues/detail?id=689
http://code.google.com/p/phantomjs/issues/detail?id=532
http://code.google.com/p/phantomjs/issues/detail?id=851
2012-11-14 11:28:58 -08:00
Ariya Hidayat 559afcd4e8 Bump the version.
http://code.google.com/p/phantomjs/issues/detail?id=863
2012-11-10 01:45:54 -08:00
Ariya Hidayat 7b84e43a10 Merge remote-tracking branch 'JamesMGreene/ExposeProcessId' 2012-11-08 06:24:32 -08:00
James M. Greene 280305797e Exposing the Process ID (PID) via the System module.
`require('system').pid` should return your PhantomJS instance's Process ID.

http://code.google.com/p/phantomjs/issues/detail?id=769
2012-11-06 11:49:55 -06:00
Ivan De Marino eadb03a978 Adding "page.onFilePicker" callback.
This addresses [Issue #843](http://code.google.com/p/phantomjs/issues/detail?id=843).
Important: this doesn't change the ability to use
"page.uploadFile", that will keep working as expected.
2012-11-03 18:41:18 +00:00
Ivan De Marino 1fa9c04845 Reworking code related to Issue #800.
This addresses [Issue #842](http://code.google.com/p/phantomjs/issues/detail?id=842).
2012-11-03 14:38:23 +00:00
Ivan De Marino 7c7d1f961c Adding "date" detection to `detectType`
Addresses [Issue #800](http://code.google.com/p/phantomjs/issues/detail?id=800)
2012-11-03 14:38:22 +00:00
Ivan De Marino 4c5e96d17f FIX: Multiple "onCallback" handlers registered.
Addresses [Issue #807](http://code.google.com/p/phantomjs/issues/detail?id=807)
2012-11-03 14:38:22 +00:00
Ivan De Marino b113993314 MINOR: Avoid frame switching if already there.
Useless to change frame if it's already the right one.
Makes it clearer what is going on when debugging.
2012-11-03 14:38:22 +00:00
Ivan De Marino 3fe308bf8c Adding Navigation methods.
Addresses [Issue #808](http://code.google.com/p/phantomjs/issues/detail?id=808)

* back()        [method]
* canGoBack     [property - boolean]
* forward()     [method]
* canGoForward  [property - boolean]
* reload()      [method]
* stop()        [method]

This is to fill a small gap we ought to deal with.
IMPORTANT: this API is asynchronous. Events
like "onLoadStarted" and "onLoadFinished" are
ideal to monitor the activity of those methods.
2012-11-03 14:38:22 +00:00
Ivan De Marino 9cf6cbe818 MINOR: Fixing typo - "splice !== slice" 2012-11-03 14:38:21 +00:00
Ivan De Marino d5eb657ecc More Douglas Crockford remedials.
Addresses [Issue #800](http://code.google.com/p/phantomjs/issues/detail?id=800)
2012-11-03 14:38:21 +00:00
Ivan De Marino e31528adfe "onLoadFinished" works regardless of "page.open"
Addresses [Issue #801](http://code.google.com/p/phantomjs/issues/detail?id=801)
2012-11-03 14:38:21 +00:00
Ivan De Marino 60ced2ccb6 Provide "detectType" inspired by D. Crockford
Addresses [Issue #800](http://code.google.com/p/phantomjs/issues/detail?id=800)
2012-11-03 14:38:21 +00:00