diff options
Diffstat (limited to 'Source')
50 files changed, 261 insertions, 276 deletions
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in index f110846..c6c76bf 100644 --- a/Source/WebCore/WebCore.exp.in +++ b/Source/WebCore/WebCore.exp.in @@ -1595,7 +1595,6 @@ __ZN7WebCore17HTMLPlugInElement11getNPObjectEv __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_ __ZNK7WebCore4KURL10protocolIsEPKc __ZNK7WebCore4KURL7hasPathEv -__ZNK7WebCore4KURL9prettyURLEv #endif #if ENABLE(ORIENTATION_EVENTS) diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.cpp b/Source/WebCore/fileapi/DOMFileSystemBase.cpp index eafb815..5a2627f 100644 --- a/Source/WebCore/fileapi/DOMFileSystemBase.cpp +++ b/Source/WebCore/fileapi/DOMFileSystemBase.cpp @@ -63,7 +63,7 @@ bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, AsyncFileSystem::Typ return false; KURL originURL(ParsedURLString, url.path()); - String path = originURL.path(); + String path = decodeURLEscapeSequences(originURL.path()); if (path.isEmpty() || path[0] != '/') return false; path = path.substring(1); diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp index 4636f20..b05e7f5 100644 --- a/Source/WebCore/html/HTMLAnchorElement.cpp +++ b/Source/WebCore/html/HTMLAnchorElement.cpp @@ -405,7 +405,10 @@ void HTMLAnchorElement::setPathname(const String& value) String HTMLAnchorElement::port() const { - return String::number(href().port()); + if (href().hasPort()) + return String::number(href().port()); + + return ""; } void HTMLAnchorElement::setPort(const String& value) diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp index f999fdb..670cf1f 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp @@ -993,7 +993,8 @@ void FrameLoader::loadArchive(PassRefPtr<Archive> prpArchive) ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages) { String mimeType = mimeTypeIn; - String extension = url.path().substring(url.path().reverseFind('.') + 1); + String decodedPath = decodeURLEscapeSequences(url.path()); + String extension = decodedPath.substring(decodedPath.reverseFind('.') + 1); // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure if (mimeType.isEmpty()) diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp index 4835a83..fb68a09 100644 --- a/Source/WebCore/page/Location.cpp +++ b/Source/WebCore/page/Location.cpp @@ -63,8 +63,7 @@ String Location::href() const if (!m_frame) return String(); - const KURL& url = this->url(); - return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; + return url().string(); } String Location::protocol() const @@ -83,7 +82,7 @@ String Location::host() const // Note: this is the IE spec. The NS spec swaps the two, it says // "The hostname property is the concatenation of the host and port properties, separated by a colon." const KURL& url = this->url(); - return url.port() ? url.host() + ":" + String::number(url.port()) : url.host(); + return url.hasPort() ? url.host() + ":" + String::number(url.port()) : url.host(); } String Location::hostname() const @@ -100,7 +99,7 @@ String Location::port() const return String(); const KURL& url = this->url(); - return url.port() ? String::number(url.port()) : ""; + return url.hasPort() ? String::number(url.port()) : ""; } String Location::pathname() const @@ -147,15 +146,6 @@ String Location::getParameter(const String& name) const return parameters.get(name); } -String Location::toString() const -{ - if (!m_frame) - return String(); - - const KURL& url = this->url(); - return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; -} - void Location::setHref(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow) { if (!m_frame) @@ -199,7 +189,7 @@ void Location::setPort(const String& portString, DOMWindow* activeWindow, DOMWin return; KURL url = m_frame->document()->url(); int port = portString.toInt(); - if (port < 0 || port > 0xFFFF) + if (port < 0 || port > 0xFFFF || portString.isEmpty()) url.removePort(); else url.setPort(port); diff --git a/Source/WebCore/page/Location.h b/Source/WebCore/page/Location.h index 1b68cee..0e89ecf 100644 --- a/Source/WebCore/page/Location.h +++ b/Source/WebCore/page/Location.h @@ -29,9 +29,9 @@ #ifndef Location_h #define Location_h -#include <wtf/Forward.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> +#include <wtf/text/WTFString.h> namespace WebCore { @@ -71,7 +71,7 @@ public: String hash() const; String origin() const; - String toString() const; + String toString() const { return href(); } String getParameter(const String&) const; diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp index 88ad3d9..234d749 100644 --- a/Source/WebCore/platform/KURL.cpp +++ b/Source/WebCore/platform/KURL.cpp @@ -708,7 +708,7 @@ String KURL::query() const String KURL::path() const { - return decodeURLEscapeSequences(m_string.substring(m_portEnd, m_pathEnd - m_portEnd)); + return m_string.substring(m_portEnd, m_pathEnd - m_portEnd); } bool KURL::setProtocol(const String& s) @@ -866,7 +866,7 @@ void KURL::setPath(const String& s) parse(m_string.left(m_portEnd) + encodeWithURLEscapeSequences(path) + m_string.substring(m_pathEnd)); } -String KURL::prettyURL() const +String KURL::deprecatedString() const { if (!m_isValid) return m_string; @@ -996,7 +996,7 @@ static void appendEscapingBadChars(char*& buffer, const char* strStart, size_t l buffer = p; } -static void escapeAndAppendFragment(char*& buffer, const char* strStart, size_t length) +static void escapeAndAppendNonHierarchicalPart(char*& buffer, const char* strStart, size_t length) { char* p = buffer; @@ -1137,6 +1137,23 @@ static inline bool hostPortIsEmptyButCredentialsArePresent(int hostStart, int po return userEndChar == '@' && hostStart == portEnd; } +static bool isNonFileHierarchicalScheme(const char* scheme, size_t schemeLength) +{ + switch (schemeLength) { + case 2: + return equal("ws", 2, scheme, schemeLength); + case 3: + return equal("ftp", 3, scheme, schemeLength) || equal("wss", 3, scheme, schemeLength); + case 4: + return equal("http", 4, scheme, schemeLength); + case 5: + return equal("https", 5, scheme, schemeLength); + case 6: + return equal("gopher", 6, scheme, schemeLength); + } + return false; +} + void KURL::parse(const char* url, const String* originalString) { if (!url || url[0] == '\0') { @@ -1173,6 +1190,7 @@ void KURL::parse(const char* url, const String* originalString) int portEnd; bool hierarchical = url[schemeEnd + 1] == '/'; + bool hasSecondSlash = hierarchical && url[schemeEnd + 2] == '/'; bool isFile = schemeEnd == 4 && matchLetter(url[0], 'f') @@ -1186,12 +1204,15 @@ void KURL::parse(const char* url, const String* originalString) && matchLetter(url[3], 'p') && (url[4] == ':' || (matchLetter(url[4], 's') && url[5] == ':')); - if (hierarchical && url[schemeEnd + 2] == '/') { + if ((hierarchical && hasSecondSlash) || isNonFileHierarchicalScheme(url, schemeEnd)) { // The part after the scheme is either a net_path or an abs_path whose first path segment is empty. // Attempt to find an authority. - // FIXME: Authority characters may be scanned twice, and it would be nice to be faster. - userStart += 2; + + if (hierarchical) + userStart++; + if (hasSecondSlash) + userStart++; userEnd = userStart; int colonPos = 0; @@ -1394,12 +1415,14 @@ void KURL::parse(const char* url, const String* originalString) m_userStart = m_userEnd = m_passwordEnd = m_hostEnd = m_portEnd = p - buffer.data(); // For canonicalization, ensure we have a '/' for no path. - // Do this only for hierarchical URL with protocol http or https. - if (m_protocolInHTTPFamily && hierarchical && pathEnd == pathStart) + // Do this only for URL with protocol http or https. + if (m_protocolInHTTPFamily && pathEnd == pathStart) *p++ = '/'; // add path, escaping bad characters - if (!hierarchical || !hasSlashDotOrDotDot(url)) + if (!hierarchical) + escapeAndAppendNonHierarchicalPart(p, url + pathStart, pathEnd - pathStart); + else if (!hasSlashDotOrDotDot(url)) appendEscapingBadChars(p, url + pathStart, pathEnd - pathStart); else { CharBuffer pathBuffer(pathEnd - pathStart + 1); @@ -1425,7 +1448,7 @@ void KURL::parse(const char* url, const String* originalString) // add fragment, escaping bad characters if (fragmentEnd != queryEnd) { *p++ = '#'; - escapeAndAppendFragment(p, url + fragmentStart, fragmentEnd - fragmentStart); + escapeAndAppendNonHierarchicalPart(p, url + fragmentStart, fragmentEnd - fragmentStart); } m_fragmentEnd = p - buffer.data(); diff --git a/Source/WebCore/platform/KURL.h b/Source/WebCore/platform/KURL.h index db2dd42..192c10b 100644 --- a/Source/WebCore/platform/KURL.h +++ b/Source/WebCore/platform/KURL.h @@ -152,7 +152,9 @@ public: String baseAsString() const; - String prettyURL() const; + // This function is only used by location.href. It's likely we shouldn't + // use it for that purpose, but more study is necessary before we remove it. + String deprecatedString() const; String fileSystemPath() const; // Returns true if the current URL's protocol is the same as the null- diff --git a/Source/WebCore/platform/KURLGoogle.cpp b/Source/WebCore/platform/KURLGoogle.cpp index 0d11b99..54bcf16 100644 --- a/Source/WebCore/platform/KURLGoogle.cpp +++ b/Source/WebCore/platform/KURLGoogle.cpp @@ -593,7 +593,6 @@ String KURL::query() const String KURL::path() const { - // Note: KURL.cpp unescapes here. return m_url.componentString(m_url.m_parsed.path); } @@ -670,16 +669,12 @@ void KURL::setPort(unsigned short i) { KURLGooglePrivate::Replacements replacements; String portStr; - if (i) { - portStr = String::number(i); - replacements.SetPort( - reinterpret_cast<const url_parse::UTF16Char*>(portStr.characters()), - url_parse::Component(0, portStr.length())); - } else { - // Clear any existing port when it is set to 0. - replacements.ClearPort(); - } + portStr = String::number(i); + replacements.SetPort( + reinterpret_cast<const url_parse::UTF16Char*>(portStr.characters()), + url_parse::Component(0, portStr.length())); + m_url.replaceComponents(replacements); } @@ -772,7 +767,7 @@ void KURL::setPath(const String& path) // On Mac, this just seems to return the same URL, but with "/foo/bar" for // file: URLs instead of file:///foo/bar. We don't bother with any of this, // at least for now. -String KURL::prettyURL() const +String KURL::deprecatedString() const { if (!m_url.m_isValid) return String(); diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp index 1de5ae7..ce520b4 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp @@ -53,4 +53,17 @@ void BaseLayerAndroid::getLocalTransform(SkMatrix* matrix) const matrix->preConcat(getMatrix()); } +IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer) +{ + if (viewport.fRight > getWidth() || viewport.fBottom > getHeight()) { + // To handle the viewport expanding past the layer's size with HW accel, + // expand the size of the layer, so that tiles will cover the viewport. + setSize(std::max(viewport.fRight, getWidth()), + std::max(viewport.fBottom, getHeight())); + } + + return LayerAndroid::updatePosition(viewport, parentIframeLayer); +} + } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h index 0ef39c8..f4cf9f3 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h @@ -49,6 +49,8 @@ public: virtual void getLocalTransform(SkMatrix* matrix) const; virtual const TransformationMatrix* drawTransform() const { return 0; } + virtual IFrameLayerAndroid* updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer); private: // TODO: move to SurfaceCollection. Color m_color; diff --git a/Source/WebCore/platform/graphics/android/layers/Layer.h b/Source/WebCore/platform/graphics/android/layers/Layer.h index 996547b..d87c699 100644 --- a/Source/WebCore/platform/graphics/android/layers/Layer.h +++ b/Source/WebCore/platform/graphics/android/layers/Layer.h @@ -157,6 +157,9 @@ protected: bool m_hasOverflowChildren; + // invalidation region + SkRegion m_dirtyRegion; +private: bool isAncestor(const Layer*) const; Layer* fParent; @@ -173,9 +176,6 @@ protected: SkTDArray<Layer*> m_children; - // invalidation region - SkRegion m_dirtyRegion; - WebCore::GLWebViewState* m_state; typedef SkRefCnt INHERITED; diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index df3fa42..81427b8 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -254,7 +254,7 @@ void LayerAndroid::addDirtyArea() area.intersect(clip); IntRect dirtyArea(area.x(), area.y(), area.width(), area.height()); - m_state->addDirtyArea(dirtyArea); + state()->addDirtyArea(dirtyArea); } void LayerAndroid::addAnimation(PassRefPtr<AndroidAnimation> prpAnim) @@ -411,7 +411,6 @@ void LayerAndroid::updatePositions() void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentMatrix, const FloatRect& clipping, float opacity, float scale) { - m_atomicSync.lock(); IntSize layerSize(getSize().width(), getSize().height()); FloatPoint anchorPoint(getAnchorPoint().fX, getAnchorPoint().fY); FloatPoint position(getPosition().fX - m_offset.x(), getPosition().fY - m_offset.y()); @@ -428,7 +427,6 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM -originY, -anchorPointZ()); - m_atomicSync.unlock(); setDrawTransform(localMatrix); if (m_drawTransform.isIdentityOrTranslation()) { // adjust the translation coordinates of the draw transform matrix so @@ -610,50 +608,6 @@ void LayerAndroid::mergeInvalsInto(LayerAndroid* replacementTree) replacementLayer->markAsDirty(m_dirtyRegion); } -bool LayerAndroid::updateWithTree(LayerAndroid* newTree) -{ -// Disable fast update for now -#if (0) - bool needsRepaint = false; - int count = this->countChildren(); - for (int i = 0; i < count; i++) - needsRepaint |= this->getChild(i)->updateWithTree(newTree); - - if (newTree) { - LayerAndroid* newLayer = newTree->findById(uniqueId()); - needsRepaint |= updateWithLayer(newLayer); - } - return needsRepaint; -#else - return true; -#endif -} - -// Return true to indicate to WebViewCore that the updates -// are too complicated to be fully handled and we need a full -// call to webkit (e.g. handle repaints) -bool LayerAndroid::updateWithLayer(LayerAndroid* layer) -{ - if (!layer) - return true; - - android::AutoMutex lock(m_atomicSync); - m_position = layer->m_position; - m_anchorPoint = layer->m_anchorPoint; - m_size = layer->m_size; - m_opacity = layer->m_opacity; - m_transform = layer->m_transform; - - if (m_imageCRC != layer->m_imageCRC) - m_visible = false; - - if ((m_content != layer->m_content) - || (m_imageCRC != layer->m_imageCRC)) - return true; - - return false; -} - static inline bool compareLayerZ(const LayerAndroid* a, const LayerAndroid* b) { return a->zValue() > b->zValue(); @@ -857,7 +811,7 @@ bool LayerAndroid::drawGL(bool layerTilesDisabled) ImagesManager::instance()->releaseImage(m_imageCRC); } - m_state->glExtras()->drawGL(this); + state()->glExtras()->drawGL(this); bool askScreenUpdate = false; m_atomicSync.lock(); diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h index 6239418..9a803a9 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h @@ -257,12 +257,6 @@ public: friend LayerAndroid* android::deserializeLayer(int version, SkStream* stream); friend void android::cleanupImageRefs(LayerAndroid* layer); - // Update layers using another tree. Only works for basic properties - // such as the position, the transform. Return true if anything more - // complex is needed. - bool updateWithTree(LayerAndroid*); - virtual bool updateWithLayer(LayerAndroid*); - LayerType type() { return m_type; } virtual SubclassType subclassType() { return LayerAndroid::StandardLayer; } diff --git a/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h index 1f289e6..52f5e7e 100644 --- a/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h @@ -43,8 +43,6 @@ public: virtual LayerAndroid* copy() const { return new ScrollableLayerAndroid(*this); } virtual SubclassType subclassType() { return LayerAndroid::ScrollableLayer; } - virtual bool updateWithLayer(LayerAndroid*) { return true; } - // Scrolls to the given position in the layer. // Returns whether or not any scrolling was required. virtual bool scrollTo(int x, int y); diff --git a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp index b2ead6a..9890331 100644 --- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp @@ -174,8 +174,8 @@ bool ImageTexture::prepareGL(GLWebViewState* state) return false; if (!m_texture && m_picture) { - bool isLayerTile = true; - m_texture = new TileGrid(isLayerTile); + bool isBaseSurface = false; + m_texture = new TileGrid(isBaseSurface); SkRegion region; region.setRect(0, 0, m_image->width(), m_image->height()); m_texture->markAsDirty(region); @@ -198,8 +198,6 @@ const TransformationMatrix* ImageTexture::transform() if (!m_layer) return 0; - FloatPoint p(0, 0); - p = m_layer->drawTransform()->mapPoint(p); IntRect layerArea = m_layer->unclippedArea(); float scaleW = static_cast<float>(layerArea.width()) / static_cast<float>(m_image->width()); float scaleH = static_cast<float>(layerArea.height()) / static_cast<float>(m_image->height()); diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.h b/Source/WebCore/platform/graphics/android/rendering/Surface.h index 27c997e..756fabd 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Surface.h +++ b/Source/WebCore/platform/graphics/android/rendering/Surface.h @@ -56,7 +56,7 @@ public: void computeTexturesAmount(TexturesResult* result); - LayerAndroid* getFirstLayer() { return m_layers[0]; } + LayerAndroid* getFirstLayer() const { return m_layers[0]; } bool needsTexture() { return m_needsTexture; } bool hasText() { return m_hasText; } bool isBase(); diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp index 0bbaf91..cd5ceef 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp @@ -95,6 +95,15 @@ void SurfaceCollection::prepareGL(const SkRect& visibleRect) m_surfaces[i]->prepareGL(layerTilesDisabled); } +static inline bool compareSurfaceZ(const Surface* a, const Surface* b) +{ + const LayerAndroid* la = a->getFirstLayer(); + const LayerAndroid* lb = b->getFirstLayer(); + + // swap drawing order if zValue suggests it AND the layers are in the same stacking context + return (la->zValue() > lb->zValue()) && (la->getParent() == lb->getParent()); +} + bool SurfaceCollection::drawGL(const SkRect& visibleRect) { #ifdef DEBUG_COUNT @@ -105,8 +114,16 @@ bool SurfaceCollection::drawGL(const SkRect& visibleRect) updateLayerPositions(visibleRect); bool layerTilesDisabled = m_compositedRoot->state()->layersRenderingMode() > GLWebViewState::kClippedTextures; + + // create a duplicate vector of surfaces, sorted by z value + Vector <Surface*> surfaces; + for (unsigned int i = 0; i < m_surfaces.size(); i++) + surfaces.append(m_surfaces[i]); + std::stable_sort(surfaces.begin()+1, surfaces.end(), compareSurfaceZ); + + // draw the sorted vector for (unsigned int i = 0; i < m_surfaces.size(); i++) - needsRedraw |= m_surfaces[i]->drawGL(layerTilesDisabled); + needsRedraw |= surfaces[i]->drawGL(layerTilesDisabled); return needsRedraw; } diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp index 35fded1..178958d 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp @@ -511,11 +511,6 @@ void Tile::validatePaint() { // paintBitmap() may have cleared m_dirty) m_dirty = true; } - - if (m_deferredDirty) { - ALOGV("Note: deferred dirty flag set, possibly a missed paint on tile %p", this); - m_deferredDirty = false; - } } else { ALOGV("Note: paint was unsuccessful."); m_state = Unpainted; diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.h b/Source/WebCore/platform/graphics/android/rendering/Tile.h index 7010301..cc10799 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.h +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.h @@ -151,9 +151,6 @@ private: // redrawn in the backTexture bool m_dirty; - // currently only for debugging, to be used for tracking down dropped repaints - bool m_deferredDirty; - // used to signal that a repaint is pending bool m_repaintPending; diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp index 63f73aa..2510d52 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp @@ -80,7 +80,7 @@ bool TileGrid::isReady() // in order to unblock the zooming process. // FIXME: have a better system -- maybe keeping the last scale factor // able to fully render everything - ALOGV("TT %p, ready %d, visible %d, texturesRemain %d", + ALOGV("TG %p, ready %d, visible %d, texturesRemain %d", this, tilesAllReady, tilesVisible, TilesManager::instance()->layerTexturesRemain()); @@ -102,7 +102,7 @@ void TileGrid::swapTiles() for (unsigned int i = 0; i < m_tiles.size(); i++) if (m_tiles[i]->swapTexturesIfNeeded()) swaps++; - ALOGV("TT %p swapping, swaps = %d", this, swaps); + ALOGV("TG %p swapping, swaps = %d", this, swaps); } IntRect TileGrid::computeTilesArea(const IntRect& contentArea, float scale) @@ -113,7 +113,7 @@ IntRect TileGrid::computeTilesArea(const IntRect& contentArea, float scale) ceilf(contentArea.width() * scale), ceilf(contentArea.height() * scale)); - ALOGV("TT %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height()); + ALOGV("TG %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height()); if (area.width() == 0 && area.height() == 0) { computedArea.setWidth(0); @@ -213,7 +213,7 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, void TileGrid::markAsDirty(const SkRegion& invalRegion) { - ALOGV("TT %p markAsDirty, current region empty %d, new empty %d", + ALOGV("TG %p markAsDirty, current region empty %d, new empty %d", this, m_dirtyRegion.isEmpty(), invalRegion.isEmpty()); m_dirtyRegion.op(invalRegion, SkRegion::kUnion_Op); } @@ -239,7 +239,7 @@ void TileGrid::prepareTile(int x, int y, TilePainter* painter, tile->reserveTexture(); if (tile->backTexture() && tile->isDirty() && !tile->isRepaintPending()) { - ALOGV("painting TT %p's tile %d %d for LG %p", this, x, y, painter); + ALOGV("painting TG %p's tile %d %d for LG %p", this, x, y, painter); PaintTileOperation *operation = new PaintTileOperation(tile, painter, state, isLowResPrefetch); TilesManager::instance()->scheduleOperation(operation); @@ -330,7 +330,7 @@ void TileGrid::drawGL(const IntRect& visibleArea, float opacity, if (semiOpaqueBaseSurface) drawMissingRegion(missingRegion, opacity, background); - ALOGV("TT %p drew %d tiles, scale %f", + ALOGV("TG %p drew %d tiles, scale %f", this, drawn, m_scale); } @@ -372,7 +372,7 @@ void TileGrid::removeTiles() void TileGrid::discardTextures() { - ALOGV("TT %p discarding textures", this); + ALOGV("TG %p discarding textures", this); for (unsigned int i = 0; i < m_tiles.size(); i++) m_tiles[i]->discardTextures(); } diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp index ec0d9e7..af19f30 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp @@ -102,7 +102,7 @@ void TransferQueue::initGLResources(int width, int height) m_sharedSurfaceTexture = #if GPU_UPLOAD_WITHOUT_DRAW new android::SurfaceTexture(m_sharedSurfaceTextureId, true, - GL_TEXTURE_2D, false, bufferQueue); + GL_TEXTURE_2D, true, bufferQueue); #else new android::SurfaceTexture(m_sharedSurfaceTextureId, true, GL_TEXTURE_EXTERNAL_OES, true, diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp index dc22fca..ec04035 100644 --- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp +++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp @@ -180,9 +180,9 @@ static void ensureSessionIsInitialized(SoupSession* session) g_object_set_data(G_OBJECT(session), "webkit-init", reinterpret_cast<void*>(0xdeadbeef)); } -void ResourceHandle::prepareForURL(const KURL &url) +void ResourceHandle::prepareForURL(const KURL& url) { - GOwnPtr<SoupURI> soupURI(soup_uri_new(url.prettyURL().utf8().data())); + GOwnPtr<SoupURI> soupURI(soup_uri_new(url.string().utf8().data())); if (!soupURI) return; soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get()); diff --git a/Source/WebCore/platform/qt/KURLQt.cpp b/Source/WebCore/platform/qt/KURLQt.cpp index f6d2a86..674a933 100644 --- a/Source/WebCore/platform/qt/KURLQt.cpp +++ b/Source/WebCore/platform/qt/KURLQt.cpp @@ -50,4 +50,3 @@ String KURL::fileSystemPath() const } } - diff --git a/Source/WebCore/platform/win/ClipboardWin.cpp b/Source/WebCore/platform/win/ClipboardWin.cpp index 0b5a3d3..2e56cbc 100644 --- a/Source/WebCore/platform/win/ClipboardWin.cpp +++ b/Source/WebCore/platform/win/ClipboardWin.cpp @@ -191,7 +191,7 @@ static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, Share WCHAR filePath[MAX_PATH]; if (url.isLocalFile()) { - String localPath = url.path(); + String localPath = decodeURLEscapeSequences(url.path()); // windows does not enjoy a leading slash on paths if (localPath[0] == '/') localPath = localPath.substring(1); diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index a90bf69..42d68a0 100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -191,7 +191,7 @@ void RenderBlock::destroy() childBox->remove(); } } - } else if (isInline() && parent()) + } else if (parent()) parent()->dirtyLinesFromChangedChild(this); } diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp index fb1dd2c..9c40d5b 100644 --- a/Source/WebCore/rendering/RenderBox.cpp +++ b/Source/WebCore/rendering/RenderBox.cpp @@ -3260,7 +3260,7 @@ bool RenderBox::shrinkToAvoidFloats() const bool RenderBox::avoidsFloats() const { - return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot(); + return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot() || isDeprecatedFlexItem(); } void RenderBox::addShadowOverflow() diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h index 1bee989..a5dc1b2 100644 --- a/Source/WebCore/rendering/RenderBox.h +++ b/Source/WebCore/rendering/RenderBox.h @@ -378,6 +378,8 @@ public: virtual void markForPaginationRelayoutIfNeeded() { } bool isWritingModeRoot() const { return !parent() || parent()->style()->writingMode() != style()->writingMode(); } + + bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrPositioned() && parent() && parent()->isFlexibleBox(); } virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp index c27d336..09a7944 100644 --- a/Source/WebCore/rendering/RenderReplaced.cpp +++ b/Source/WebCore/rendering/RenderReplaced.cpp @@ -57,6 +57,14 @@ RenderReplaced::~RenderReplaced() { } +void RenderReplaced::destroy() +{ + if (!documentBeingDestroyed() && parent()) + parent()->dirtyLinesFromChangedChild(this); + + RenderBox::destroy(); +} + void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBox::styleDidChange(diff, oldStyle); diff --git a/Source/WebCore/rendering/RenderReplaced.h b/Source/WebCore/rendering/RenderReplaced.h index d6ebba6..29fc71c 100644 --- a/Source/WebCore/rendering/RenderReplaced.h +++ b/Source/WebCore/rendering/RenderReplaced.h @@ -32,6 +32,8 @@ public: RenderReplaced(Node*, const IntSize& intrinsicSize); virtual ~RenderReplaced(); + virtual void destroy(); + protected: virtual void layout(); diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp index 894d689..97444cd 100644 --- a/Source/WebCore/rendering/RenderWidget.cpp +++ b/Source/WebCore/rendering/RenderWidget.cpp @@ -125,6 +125,10 @@ void RenderWidget::destroy() document()->axObjectCache()->childrenChanged(this->parent()); document()->axObjectCache()->remove(this); } + + if (!documentBeingDestroyed() && parent()) + parent()->dirtyLinesFromChangedChild(this); + remove(); if (m_hasCounterNodeMap) diff --git a/Source/WebCore/workers/WorkerLocation.cpp b/Source/WebCore/workers/WorkerLocation.cpp index b934abd..319a528 100644 --- a/Source/WebCore/workers/WorkerLocation.cpp +++ b/Source/WebCore/workers/WorkerLocation.cpp @@ -36,7 +36,7 @@ namespace WebCore { String WorkerLocation::href() const { - return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/"; + return m_url.string(); } String WorkerLocation::protocol() const @@ -74,11 +74,6 @@ String WorkerLocation::hash() const return m_url.fragmentIdentifier().isEmpty() ? "" : "#" + m_url.fragmentIdentifier(); } -String WorkerLocation::toString() const -{ - return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/"; -} - } // namespace WebCore diff --git a/Source/WebCore/workers/WorkerLocation.h b/Source/WebCore/workers/WorkerLocation.h index 5200e35..692c0e3 100644 --- a/Source/WebCore/workers/WorkerLocation.h +++ b/Source/WebCore/workers/WorkerLocation.h @@ -30,10 +30,10 @@ #if ENABLE(WORKERS) #include "KURL.h" -#include <wtf/Forward.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> +#include <wtf/text/WTFString.h> namespace WebCore { @@ -57,7 +57,7 @@ namespace WebCore { String search() const; String hash() const; - String toString() const; + String toString() const { return href(); } private: WorkerLocation(const KURL& url) : m_url(url) { } diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 207fe9a..c10f5b3 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -95,7 +95,7 @@ void ChromeClientAndroid::scheduleCompositingLayerSync() m_needsLayerSync = true; WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_webFrame->page()->mainFrame()->view()); if (webViewCore) - webViewCore->layersDraw(); + webViewCore->contentDraw(); } void ChromeClientAndroid::setNeedsOneShotDrawingSynchronization() diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index d0f3830..7a2971a 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -316,7 +316,6 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* ALOG_ASSERT(mJavaFrame->mAutoLogin, "Could not find method autoLogin"); mUserAgent = WTF::String(); - mUserInitiatedAction = false; mBlockNetworkLoads = false; m_renderSkins = 0; } diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.h b/Source/WebKit/android/jni/WebCoreFrameBridge.h index 13f99af..30c1d83 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.h +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.h @@ -128,13 +128,6 @@ class WebFrame : public WebCoreRefObject { // application. void autoLogin(const std::string& loginHeader); - /** - * When the user initiates a click, we set mUserInitiatedAction to true. - * If a load happens due to this click, then we ask the application if it wants - * to override the load. Otherwise, we attempt to load the resource internally. - */ - void setUserInitiatedAction(bool userInitiatedAction) { mUserInitiatedAction = userInitiatedAction; } - WebCore::Page* page() const { return mPage; } // Currently used only by the chrome net stack. A similar field is used by @@ -163,7 +156,6 @@ class WebFrame : public WebCoreRefObject { WebCore::Page* mPage; WTF::String mUserAgent; bool mBlockNetworkLoads; - bool mUserInitiatedAction; WebCore::RenderSkinAndroid* m_renderSkins; }; diff --git a/Source/WebKit/android/jni/WebCoreJni.cpp b/Source/WebKit/android/jni/WebCoreJni.cpp index 6dfc9f1..72ded59 100644 --- a/Source/WebKit/android/jni/WebCoreJni.cpp +++ b/Source/WebKit/android/jni/WebCoreJni.cpp @@ -118,8 +118,10 @@ jobject intRectToRect(JNIEnv* env, const WebCore::IntRect& rect) ALOG_ASSERT(rectClass, "Could not find android/graphics/Rect"); jmethodID rectInit = env->GetMethodID(rectClass, "<init>", "(IIII)V"); ALOG_ASSERT(rectInit, "Could not find init method on Rect"); - return env->NewObject(rectClass, rectInit, rect.x(), rect.y(), + jobject jrect = env->NewObject(rectClass, rectInit, rect.x(), rect.y(), rect.maxX(), rect.maxY()); + env->DeleteLocalRef(rectClass); + return jrect; } jobjectArray intRectVectorToRectArray(JNIEnv* env, Vector<WebCore::IntRect>& rects) diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index a4cd94f..cdd484b 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -108,6 +108,7 @@ #include "ResourceRequest.h" #include "RuntimeEnabledFeatures.h" #include "SchemeRegistry.h" +#include "ScopedLocalRef.h" #include "ScriptController.h" #include "SelectionController.h" #include "SelectText.h" @@ -323,7 +324,6 @@ struct WebViewCore::JavaGlue { jweak m_obj; jmethodID m_scrollTo; jmethodID m_contentDraw; - jmethodID m_layersDraw; jmethodID m_requestListBox; jmethodID m_openFileChooser; jmethodID m_requestSingleListBox; @@ -397,7 +397,7 @@ struct WebViewCore::TextFieldInitDataGlue { jfieldID m_name; jfieldID m_label; jfieldID m_maxLength; - jfieldID m_nodeBounds; + jfieldID m_contentBounds; jfieldID m_nodeLayerId; jfieldID m_contentRect; }; @@ -456,7 +456,6 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_obj = env->NewWeakGlobalRef(javaWebViewCore); m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(IIZZ)V"); m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V"); - m_javaGlue->m_layersDraw = GetJMethod(env, clazz, "layersDraw", "()V"); m_javaGlue->m_requestListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[I[I)V"); m_javaGlue->m_openFileChooser = GetJMethod(env, clazz, "openFileChooser", "(Ljava/lang/String;)Ljava/lang/String;"); m_javaGlue->m_requestSingleListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[II)V"); @@ -523,7 +522,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_textFieldInitDataGlue->m_name = env->GetFieldID(tfidClazz, "mName", "Ljava/lang/String;"); m_textFieldInitDataGlue->m_label = env->GetFieldID(tfidClazz, "mLabel", "Ljava/lang/String;"); m_textFieldInitDataGlue->m_maxLength = env->GetFieldID(tfidClazz, "mMaxLength", "I"); - m_textFieldInitDataGlue->m_nodeBounds = env->GetFieldID(tfidClazz, "mNodeBounds", "Landroid/graphics/Rect;"); + m_textFieldInitDataGlue->m_contentBounds = env->GetFieldID(tfidClazz, "mContentBounds", "Landroid/graphics/Rect;"); m_textFieldInitDataGlue->m_nodeLayerId = env->GetFieldID(tfidClazz, "mNodeLayerId", "I"); m_textFieldInitDataGlue->m_contentRect = env->GetFieldID(tfidClazz, "mContentRect", "Landroid/graphics/Rect;"); m_textFieldInitDataGlue->m_constructor = GetJMethod(env, tfidClazz, "<init>", "()V"); @@ -858,18 +857,6 @@ void WebViewCore::rebuildPictureSet(PictureSet* pictureSet) #endif } -bool WebViewCore::updateLayers(LayerAndroid* layers) -{ - // We update the layers - ChromeClientAndroid* chromeC = static_cast<ChromeClientAndroid*>(m_mainFrame->page()->chrome()->client()); - GraphicsLayerAndroid* root = static_cast<GraphicsLayerAndroid*>(chromeC->layersSync()); - if (root) { - LayerAndroid* updatedLayer = root->contentLayer(); - return layers->updateWithTree(updatedLayer); - } - return true; -} - void WebViewCore::notifyAnimationStarted() { // We notify webkit that the animations have begun @@ -1020,16 +1007,6 @@ void WebViewCore::contentDraw() checkException(env); } -void WebViewCore::layersDraw() -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue->object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue->m_layersDraw); - checkException(env); -} - void WebViewCore::contentInvalidate(const WebCore::IntRect &r) { DBG_SET_LOGD("rect={%d,%d,w=%d,h=%d}", r.x(), r.y(), r.width(), r.height()); @@ -1649,7 +1626,7 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection) RenderText* renderText = toRenderText(r); int caretOffset; InlineBox* inlineBox; - start.getInlineBoxAndOffset(DOWNSTREAM, inlineBox, caretOffset); + start.getInlineBoxAndOffset(selection.affinity(), inlineBox, caretOffset); startHandle = renderText->localCaretRect(inlineBox, caretOffset); FloatPoint absoluteOffset = renderText->localToAbsolute(startHandle.location()); startHandle.setX(absoluteOffset.x() - layerOffset.x()); @@ -1698,19 +1675,19 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection) selectTextContainer->setText(range->text()); selectTextContainer->setTextRect(SelectText::StartHandle, - positionToTextRect(selection.start())); + positionToTextRect(selection.start(), selection.affinity())); selectTextContainer->setTextRect(SelectText::EndHandle, - positionToTextRect(selection.end())); + positionToTextRect(selection.end(), selection.affinity())); return selectTextContainer; } -IntRect WebViewCore::positionToTextRect(const Position& position) +IntRect WebViewCore::positionToTextRect(const Position& position, EAffinity affinity) { IntRect textRect; InlineBox* inlineBox; int offset; - position.getInlineBoxAndOffset(VP_DEFAULT_AFFINITY, inlineBox, offset); + position.getInlineBoxAndOffset(affinity, inlineBox, offset); if (inlineBox && inlineBox->isInlineTextBox()) { InlineTextBox* box = static_cast<InlineTextBox*>(inlineBox); RootInlineBox* root = box->root(); @@ -2960,17 +2937,17 @@ void WebViewCore::passToJs(int generation, const WTF::String& current, updateTextSelection(); } -void WebViewCore::scrollFocusedTextInput(float xPercent, int y) +WebCore::IntRect WebViewCore::scrollFocusedTextInput(float xPercent, int y) { WebCore::Node* focus = currentFocus(); if (!focus) { clearTextEntry(); - return; + return WebCore::IntRect(); } WebCore::RenderTextControl* renderText = toRenderTextControl(focus); if (!renderText) { clearTextEntry(); - return; + return WebCore::IntRect(); } int x = (int) (xPercent * (renderText->scrollWidth() - @@ -2978,6 +2955,9 @@ void WebViewCore::scrollFocusedTextInput(float xPercent, int y) renderText->setScrollLeft(x); renderText->setScrollTop(y); focus->document()->frame()->selection()->recomputeCaretRect(); + LayerAndroid* layer = 0; + platformLayerIdFromNode(focus, &layer); + return absoluteContentRect(focus, layer); } void WebViewCore::setFocusControllerActive(bool active) @@ -3285,6 +3265,23 @@ void WebViewCore::touchUp(int touchGeneration, handleMouseClick(frame, node, false); } +bool WebViewCore::performMouseClick() +{ + WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, + WebCore::MouseEventPressed, 1, false, false, false, false, + WTF::currentTime()); + // ignore the return from as it will return true if the hit point can trigger selection change + m_mainFrame->eventHandler()->handleMousePressEvent(mouseDown); + WebCore::PlatformMouseEvent mouseUp(m_mousePos, m_mousePos, WebCore::LeftButton, + WebCore::MouseEventReleased, 1, false, false, false, false, + WTF::currentTime()); + bool handled = m_mainFrame->eventHandler()->handleMouseReleaseEvent(mouseUp); + + WebCore::Node* focusNode = currentFocus(); + initializeTextInput(focusNode, false); + return handled; +} + // Check for the "x-webkit-soft-keyboard" attribute. If it is there and // set to hidden, do not show the soft keyboard. Node passed as a parameter // must not be null. @@ -3312,15 +3309,12 @@ bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* node // Need to special case area tags because an image map could have an area element in the middle // so when attempting to get the default, the point chosen would be follow the wrong link. if (nodePtr->hasTagName(WebCore::HTMLNames::areaTag)) { - webFrame->setUserInitiatedAction(true); nodePtr->dispatchSimulatedClick(0, true, true); - webFrame->setUserInitiatedAction(false); return true; } } if (!valid || !framePtr) framePtr = m_mainFrame; - webFrame->setUserInitiatedAction(true); WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, WebCore::MouseEventPressed, 1, false, false, false, false, WTF::currentTime()); @@ -3330,7 +3324,6 @@ bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* node WebCore::MouseEventReleased, 1, false, false, false, false, WTF::currentTime()); bool handled = framePtr->eventHandler()->handleMouseReleaseEvent(mouseUp); - webFrame->setUserInitiatedAction(false); WebCore::Node* focusNode = currentFocus(); initializeTextInput(focusNode, fake); @@ -3407,34 +3400,37 @@ bool WebViewCore::isAutoCompleteEnabled(Node* node) return isEnabled; } -WebCore::IntRect WebViewCore::boundingRect(WebCore::Node* node, +WebCore::IntRect WebViewCore::absoluteContentRect(WebCore::Node* node, LayerAndroid* layer) { - // Caret selection - IntRect boundingRect; + IntRect contentRect; if (node) { RenderObject* render = node->renderer(); - if (render && !render->isBody()) { + if (render && render->isBox() && !render->isBody()) { IntPoint offset = convertGlobalContentToFrameContent(IntPoint(), node->document()->frame()); WebViewCore::layerToAbsoluteOffset(layer, offset); - boundingRect = render->absoluteBoundingBoxRect(true); - boundingRect.move(-offset.x(), -offset.y()); + + RenderBox* renderBox = toRenderBox(render); + contentRect = renderBox->absoluteContentBox(); + contentRect.move(-offset.x(), -offset.y()); } } - return boundingRect; + return contentRect; } jobject WebViewCore::createTextFieldInitData(Node* node) { JNIEnv* env = JSC::Bindings::getJNIEnv(); TextFieldInitDataGlue* classDef = m_textFieldInitDataGlue; - jclass clazz = env->FindClass("android/webkit/WebViewCore$TextFieldInitData"); - jobject initData = env->NewObject(clazz, classDef->m_constructor); + ScopedLocalRef<jclass> clazz(env, + env->FindClass("android/webkit/WebViewCore$TextFieldInitData")); + jobject initData = env->NewObject(clazz.get(), classDef->m_constructor); env->SetIntField(initData, classDef->m_fieldPointer, reinterpret_cast<int>(node)); - env->SetObjectField(initData, classDef->m_text, + ScopedLocalRef<jstring> inputText(env, wtfStringToJstring(env, getInputText(node), true)); + env->SetObjectField(initData, classDef->m_text, inputText.get()); env->SetIntField(initData, classDef->m_type, getInputType(node)); env->SetBooleanField(initData, classDef->m_isSpellCheckEnabled, isSpellCheckEnabled(node)); @@ -3448,16 +3444,18 @@ jobject WebViewCore::createTextFieldInitData(Node* node) isTextInput(document->previousFocusableNode(node, tabEvent.get()))); env->SetBooleanField(initData, classDef->m_isAutoCompleteEnabled, isAutoCompleteEnabled(node)); - env->SetObjectField(initData, classDef->m_name, + ScopedLocalRef<jstring> fieldName(env, wtfStringToJstring(env, getFieldName(node), false)); - env->SetObjectField(initData, classDef->m_name, + env->SetObjectField(initData, classDef->m_name, fieldName.get()); + ScopedLocalRef<jstring> label(env, wtfStringToJstring(env, requestLabel(document->frame(), node), false)); + env->SetObjectField(initData, classDef->m_name, label.get()); env->SetIntField(initData, classDef->m_maxLength, getMaxLength(node)); LayerAndroid* layer = 0; int layerId = platformLayerIdFromNode(node, &layer); - IntRect bounds = boundingRect(node, layer); - env->SetObjectField(initData, classDef->m_nodeBounds, - intRectToRect(env, bounds)); + IntRect bounds = absoluteContentRect(node, layer); + ScopedLocalRef<jobject> jbounds(env, intRectToRect(env, bounds)); + env->SetObjectField(initData, classDef->m_contentBounds, jbounds.get()); env->SetIntField(initData, classDef->m_nodeLayerId, layerId); IntRect contentRect; RenderTextControl* rtc = toRenderTextControl(node); @@ -3466,8 +3464,8 @@ jobject WebViewCore::createTextFieldInitData(Node* node) contentRect.setHeight(rtc->scrollHeight()); contentRect.move(-rtc->scrollLeft(), -rtc->scrollTop()); } - env->SetObjectField(initData, classDef->m_contentRect, - intRectToRect(env, contentRect)); + ScopedLocalRef<jobject> jcontentRect(env, intRectToRect(env, contentRect)); + env->SetObjectField(initData, classDef->m_contentRect, jcontentRect.get()); return initData; } @@ -3482,9 +3480,9 @@ void WebViewCore::initEditField(Node* node) int end = 0; getSelectionOffsets(node, start, end); SelectText* selectText = createSelectText(focusedFrame()->selection()->selection()); + ScopedLocalRef<jobject> initData(env, createTextFieldInitData(node)); env->CallVoidMethod(javaObject.get(), m_javaGlue->m_initEditField, - start, end, reinterpret_cast<int>(selectText), - createTextFieldInitData(node)); + start, end, reinterpret_cast<int>(selectText), initData.get()); checkException(env); } @@ -4538,10 +4536,12 @@ static void PassToJs(JNIEnv* env, jobject obj, jint nativeClass, } static void ScrollFocusedTextInput(JNIEnv* env, jobject obj, jint nativeClass, - jfloat xPercent, jint y) + jfloat xPercent, jint y, jobject contentBounds) { WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - viewImpl->scrollFocusedTextInput(xPercent, y); + IntRect bounds = viewImpl->scrollFocusedTextInput(xPercent, y); + if (contentBounds) + GraphicsJNI::irect_to_jrect(bounds, env, contentBounds); } static void SetFocusControllerActive(JNIEnv* env, jobject obj, jint nativeClass, @@ -4567,19 +4567,6 @@ void WebViewCore::addVisitedLink(const UChar* string, int length) m_groupForVisitedLinks->addVisitedLink(string, length); } -static bool UpdateLayers(JNIEnv* env, jobject obj, jint nativeClass, - jint jbaseLayer) -{ - WebViewCore* viewImpl = (WebViewCore*) nativeClass; - BaseLayerAndroid* baseLayer = (BaseLayerAndroid*) jbaseLayer; - if (baseLayer) { - LayerAndroid* root = static_cast<LayerAndroid*>(baseLayer->getChild(0)); - if (root) - return viewImpl->updateLayers(root); - } - return true; -} - static void NotifyAnimationStarted(JNIEnv* env, jobject obj, jint nativeClass) { WebViewCore* viewImpl = (WebViewCore*) nativeClass; @@ -4688,6 +4675,12 @@ static void TouchUp(JNIEnv* env, jobject obj, jint nativeClass, (WebCore::Frame*) frame, (WebCore::Node*) node, x, y); } +static bool MouseClick(JNIEnv* env, jobject obj, jint nativeClass) +{ + WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); + return viewImpl->performMouseClick(); +} + static jstring RetrieveHref(JNIEnv* env, jobject obj, jint nativeClass, jint x, jint y) { @@ -5097,7 +5090,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) MoveMouse }, { "passToJs", "(IILjava/lang/String;IIZZZZ)V", (void*) PassToJs }, - { "nativeScrollFocusedTextInput", "(IFI)V", + { "nativeScrollFocusedTextInput", "(IFILandroid/graphics/Rect;)V", (void*) ScrollFocusedTextInput }, { "nativeSetFocusControllerActive", "(IZ)V", (void*) SetFocusControllerActive }, @@ -5109,6 +5102,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) HandleTouchEvent }, { "nativeTouchUp", "(IIIIII)V", (void*) TouchUp }, + { "nativeMouseClick", "(I)Z", + (void*) MouseClick }, { "nativeRetrieveHref", "(III)Ljava/lang/String;", (void*) RetrieveHref }, { "nativeRetrieveAnchorText", "(III)Ljava/lang/String;", @@ -5117,8 +5112,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) RetrieveImageSource }, { "nativeGetContentMinPrefWidth", "(I)I", (void*) GetContentMinPrefWidth }, - { "nativeUpdateLayers", "(II)Z", - (void*) UpdateLayers }, { "nativeNotifyAnimationStarted", "(I)V", (void*) NotifyAnimationStarted }, { "nativeRecordContent", "(ILandroid/graphics/Region;Landroid/graphics/Point;)I", diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 5e2bafb..00b4bda 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -350,6 +350,11 @@ namespace android { WebCore::Node* node, int x, int y); /** + * Clicks the mouse at its current location + */ + bool performMouseClick(); + + /** * Sets the index of the label from a popup */ void popupReply(int index); @@ -410,7 +415,7 @@ namespace android { /** * Scroll the focused textfield to (x, y) in document space */ - void scrollFocusedTextInput(float x, int y); + WebCore::IntRect scrollFocusedTextInput(float x, int y); /** * Set the FocusController's active and focused states, so that * the caret will draw (true) or not. @@ -748,9 +753,10 @@ namespace android { static int getMaxLength(WebCore::Node* node); static WTF::String getFieldName(WebCore::Node* node); static bool isAutoCompleteEnabled(WebCore::Node* node); - WebCore::IntRect boundingRect(WebCore::Node* node, - WebCore::LayerAndroid* layer); - static WebCore::IntRect positionToTextRect(const WebCore::Position& position); + WebCore::IntRect absoluteContentRect(WebCore::Node* node, + WebCore::LayerAndroid* layer); + static WebCore::IntRect positionToTextRect(const WebCore::Position& position, + WebCore::EAffinity affinity); // called from constructor, to add this to a global list static void addInstance(WebViewCore*); diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index a4381e6..44ad1c5 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -306,7 +306,8 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, DrawExtras extras, bool spli int sc = canvas->save(SkCanvas::kClip_SaveFlag); canvas->clipRect(SkRect::MakeLTRB(0, 0, content->width(), content->height()), SkRegion::kDifference_Op); - canvas->drawColor(bgColor); + Color c = m_baseLayer->getBackgroundColor(); + canvas->drawColor(SkColorSetARGBInline(c.alpha(), c.red(), c.green(), c.blue())); canvas->restoreToCount(sc); // call this to be sure we've adjusted for any scrolling or animations @@ -592,6 +593,19 @@ void setTextSelection(SelectText *selection) { setDrawExtra(selection, DrawExtrasSelection); } +const TransformationMatrix* getLayerTransform(int layerId) { + if (layerId != -1 && m_baseLayer) { + LayerAndroid* layer = m_baseLayer->findById(layerId); + // We need to make sure the drawTransform is up to date as this is + // called before a draw() or drawGL() + if (layer) { + m_baseLayer->updateLayerPositions(m_visibleRect); + return layer->drawTransform(); + } + } + return 0; +} + int getHandleLayerId(SelectText::HandleId handleId, SkIPoint& cursorPoint, FloatQuad& textBounds) { SelectText* selectText = static_cast<SelectText*>(getDrawExtra(DrawExtrasSelection)); @@ -602,36 +616,24 @@ int getHandleLayerId(SelectText::HandleId handleId, SkIPoint& cursorPoint, IntRect textRect = selectText->textRect(handleId); // Rects exclude the last pixel on right/bottom. We want only included pixels. cursorPoint.set(cursorRect.x(), cursorRect.maxY() - 1); - textRect.setHeight(textRect.height() - 1); - textRect.setWidth(textRect.width() - 1); + textRect.setHeight(std::max(1, textRect.height() - 1)); + textRect.setWidth(std::max(1, textRect.width() - 1)); textBounds = FloatQuad(textRect); - if (layerId != -1) { - // We need to make sure the drawTransform is up to date as this is - // called before a draw() or drawGL() - m_baseLayer->updateLayerPositions(m_visibleRect); - LayerAndroid* root = m_baseLayer; - LayerAndroid* layer = root ? root->findById(layerId) : 0; - if (layer && layer->drawTransform()) { - const TransformationMatrix* transform = layer->drawTransform(); - // We're overloading the concept of Rect to be just the two - // points (bottom-left and top-right. - cursorPoint = transform->mapPoint(cursorPoint); - textBounds = transform->mapQuad(textBounds); - } + const TransformationMatrix* transform = getLayerTransform(layerId); + if (transform) { + // We're overloading the concept of Rect to be just the two + // points (bottom-left and top-right. + cursorPoint = transform->mapPoint(cursorPoint); + textBounds = transform->mapQuad(textBounds); } return layerId; } void mapLayerRect(int layerId, SkIRect& rect) { - if (layerId != -1) { - // We need to make sure the drawTransform is up to date as this is - // called before a draw() or drawGL() - m_baseLayer->updateLayerPositions(m_visibleRect); - LayerAndroid* layer = m_baseLayer ? m_baseLayer->findById(layerId) : 0; - if (layer && layer->drawTransform()) - rect = layer->drawTransform()->mapRect(rect); - } + const TransformationMatrix* transform = getLayerTransform(layerId); + if (transform) + transform->mapRect(rect); } void floatQuadToQuadF(JNIEnv* env, const FloatQuad& nativeTextQuad, diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index ce2ac1b..6459887 100644 --- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -360,7 +360,7 @@ void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned if (!url.isEmpty() && url != m_hoveredLinkURL) { const char* link[2]; TextDirection dir; - CString urlStr = url.prettyURL().utf8(); + CString urlStr = url.string().utf8(); CString titleStr = hit.title(dir).utf8(); link[0] = urlStr.data(); link[1] = titleStr.data(); diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index 9a409f2..021188a 100644 --- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -209,7 +209,7 @@ void FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge(DocumentLoad void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& coreRequest, const ResourceResponse& coreResponse) { - CString url = coreRequest.url().prettyURL().utf8(); + CString url = coreRequest.url().string().utf8(); DBG("Resource url=%s", url.data()); Ewk_Frame_Resource_Request request = { 0, identifier }; @@ -236,7 +236,7 @@ bool FrameLoaderClientEfl::shouldUseCredentialStorage(DocumentLoader*, unsigned void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest& coreRequest) { - CString url = coreRequest.url().prettyURL().utf8(); + CString url = coreRequest.url().string().utf8(); DBG("Resource url=%s", url.data()); Ewk_Frame_Resource_Request request = { 0, identifier }; @@ -309,7 +309,7 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFu ASSERT(m_frame); // if not acceptNavigationRequest - look at Qt -> PolicyIgnore; // FIXME: do proper check and only reset forms when on PolicyIgnore - char* url = strdup(resourceRequest.url().prettyURL().utf8().data()); + char* url = strdup(resourceRequest.url().string().utf8().data()); Ewk_Frame_Resource_Request request = { url, 0 }; Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request); free(url); @@ -764,7 +764,7 @@ void FrameLoaderClientEfl::download(ResourceHandle*, const ResourceRequest& requ if (!m_view) return; - CString url = request.url().prettyURL().utf8(); + CString url = request.url().string().utf8(); Ewk_Download download; download.url = url.data(); @@ -784,7 +784,7 @@ enum { ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& request) { - ResourceError error("Error", -999, request.url().prettyURL(), + ResourceError error("Error", -999, request.url().string(), "Request cancelled"); error.setIsCancellation(true); return error; @@ -792,7 +792,7 @@ ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& reques ResourceError FrameLoaderClientEfl::blockedError(const ResourceRequest& request) { - return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(), + return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().string(), "Request blocked"); } diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp index 4e52b56..e865d39 100644 --- a/Source/WebKit/efl/ewk/ewk_frame.cpp +++ b/Source/WebKit/efl/ewk/ewk_frame.cpp @@ -1162,7 +1162,7 @@ Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* o, int x, int y) hit_test->frame = kit(result.innerNonSharedNode()->document()->frame()); hit_test->link.text = eina_stringshare_add(result.textContent().utf8().data()); - hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().prettyURL().utf8().data()); + hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().string().utf8().data()); hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data()); hit_test->link.target_frame = kit(result.targetFrame()); @@ -2014,7 +2014,7 @@ Eina_Bool ewk_frame_uri_changed(Evas_Object* o) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); - WTF::CString uri(sd->frame->document()->url().prettyURL().utf8()); + WTF::CString uri(sd->frame->document()->url().string().utf8()); INF("uri=%s", uri.data()); if (!uri.data()) { diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index a6749de..f830426 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -577,7 +577,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) priv->page_settings->setUsesEncodingDetector(true); url = priv->page_settings->userStyleSheetLocation(); - priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data()); + priv->settings.user_stylesheet = eina_stringshare_add(url.string().utf8().data()); priv->settings.encoding_default = eina_stringshare_add (priv->page_settings->defaultTextEncodingName().utf8().data()); @@ -4077,7 +4077,7 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Objec { DBG("o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s", o, frame, name.utf8().data(), ownerElement, - url.prettyURL().utf8().data(), referrer.utf8().data()); + url.string().utf8().data(), referrer.utf8().data()); EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); @@ -4109,7 +4109,7 @@ WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Obj { DBG("o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s", o, frame, pluginSize.width(), pluginSize.height(), element, - url.prettyURL().utf8().data(), mimeType.utf8().data()); + url.string().utf8().data(), mimeType.utf8().data()); EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); sd->changed.frame_rect = EINA_TRUE; diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 9f21139..4ee9c1a 100644 --- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -549,7 +549,7 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned mo if (!url.isEmpty() && url != m_hoveredLinkURL) { TextDirection dir; CString titleString = hit.title(dir).utf8(); - CString urlString = url.prettyURL().utf8(); + CString urlString = url.string().utf8(); g_signal_emit_by_name(m_webView, "hovering-over-link", titleString.data(), urlString.data()); m_hoveredLinkURL = url; } diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 539675a..de85a67 100644 --- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -895,7 +895,7 @@ void FrameLoaderClient::dispatchDidChangeLocationWithinPage() { WebKitWebFramePrivate* priv = m_frame->priv; g_free(priv->uri); - priv->uri = g_strdup(core(m_frame)->document()->url().prettyURL().utf8().data()); + priv->uri = g_strdup(core(m_frame)->document()->url().string().utf8().data()); g_object_notify(G_OBJECT(m_frame), "uri"); WebKitWebView* webView = getViewFromFrame(m_frame); if (m_frame == webkit_web_view_get_main_frame(webView)) @@ -986,7 +986,7 @@ void FrameLoaderClient::dispatchDidCommitLoad() WebKitWebFramePrivate* priv = m_frame->priv; g_free(priv->uri); - priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().prettyURL().utf8().data()); + priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().string().utf8().data()); g_free(priv->title); priv->title = NULL; g_object_notify(G_OBJECT(m_frame), "uri"); diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index 85ad904..3b9ebe3 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -5034,7 +5034,7 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView, G_CONST_RETURN gchar* webkit_web_view_get_icon_uri(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); - String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url().prettyURL()); + String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url().string()); webView->priv->iconURI = iconURL.utf8(); return webView->priv->iconURI.data(); } diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index ea2c826..f30e0f8 100644 --- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -497,7 +497,7 @@ void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsign lastHoverURL = result.absoluteLinkURL(); lastHoverTitle = result.title(dir); lastHoverContent = result.textContent(); - emit m_webPage->linkHovered(lastHoverURL.prettyURL(), + emit m_webPage->linkHovered(lastHoverURL.string(), lastHoverTitle, lastHoverContent); } } diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index d083f8f..c35cf3b 100644 --- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -797,7 +797,7 @@ void FrameLoaderClientQt::updateGlobalHistory() QWebHistoryInterface* history = QWebHistoryInterface::defaultInterface(); WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader(); if (history) - history->addHistoryEntry(loader->urlForHistory().prettyURL()); + history->addHistoryEntry(loader->urlForHistory().string()); if (dumpHistoryCallbacks) { printf("WebView navigated to url \"%s\" with title \"%s\" with HTTP equivalent method \"%s\". The navigation was %s and was %s%s.\n", @@ -921,7 +921,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) { - ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), + ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(), QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); error.setIsCancellation(true); return error; @@ -941,7 +941,7 @@ enum { WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request) { - return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(), + return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().string(), QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); } @@ -1345,7 +1345,7 @@ void FrameLoaderClientQt::transferLoadingResourceFromPage(unsigned long, Documen ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages) { - // qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<mimeTypeIn; + // qDebug()<<" ++++++++++++++++ url is "<<url.string()<<", mime = "<<mimeTypeIn; QFileInfo fi(url.path()); String extension = fi.suffix(); if (mimeTypeIn == "application/x-qt-plugin" || mimeTypeIn == "application/x-qt-styled-widget") @@ -1508,8 +1508,8 @@ private: PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) { - // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType; - // qDebug()<<"------\t url = "<<url.prettyURL(); + // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.string() << mimeType; + // qDebug()<<"------\t url = "<<url.string(); if (!m_webFrame) return 0; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp index 61c2a3a..ace9599 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp @@ -51,7 +51,7 @@ enum { ResourceError cancelledError(const ResourceRequest& request) { - ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), + ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(), QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); error.setIsCancellation(true); return error; @@ -59,7 +59,7 @@ ResourceError cancelledError(const ResourceRequest& request) ResourceError blockedError(const ResourceRequest& request) { - return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(), + return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().string(), QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); } |
