// Checking if this point is in viewport area. If the calcualated
// point/Left/Right point are in view port then draw else do not draw the
// context menu. Only draw the selection points.
+ bool isSubFrameFocused = false;
+ IntRect focusedFrameViewPort;
+ IntRect viewportRect;
FloatRect unscaledRect = FloatRect(m_viewImpl->pageClient->visibleContentRect());
unscaledRect.scale(1 / m_viewImpl->pageClient->scaleFactor());
- IntRect viewportRect = enclosingIntRect(unscaledRect);
+
+ isSubFrameFocused = m_viewImpl->page()->getFocusedSubFrameRect(focusedFrameViewPort);
+ if (isSubFrameFocused) {
+ // Intersecting FocusedSubFrame with MainFrame visibleContentRect.
+ IntRect mainFrameViewPort = enclosedIntRect(unscaledRect);
+ if (focusedFrameViewPort.intersects(mainFrameViewPort))
+ focusedFrameViewPort.intersect(mainFrameViewPort);
+ viewportRect = focusedFrameViewPort;
+ } else
+ viewportRect = enclosingIntRect(unscaledRect);
WebCore::IntPoint visiblePoint = leftRect.center();
if (viewportRect.contains(visiblePoint)) {
// draw context menu at right point if visible
point = rightRect.maxXMinYCorner();
isPresentInViewPort = true;
- }
- else if (leftRect.y() < viewportRect.y() && rightRect.maxY() > viewportRect.maxY()) {
+ } else if (leftRect.y() < viewportRect.y() && rightRect.maxY() > viewportRect.maxY()) {
// If left and right selection handler is not present in the view port,
// always context menu shows middle of the view port.
// Selection on position element in case of selectAll handled same
bool selectionRangeClear();
bool scrollContentByCharacter(const WebCore::IntPoint&, WebCore::SelectionDirection direction);
bool scrollContentByLine(const WebCore::IntPoint&, WebCore::SelectionDirection direction);
+ bool getFocusedSubFrameRect(WebCore::IntRect&);
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)
return result;
}
+bool WebPageProxy::getFocusedSubFrameRect(IntRect& focusedFrameViewRect) {
+ if (!isValid())
+ return false;
+
+ bool isSubFrameFocused = false;
+
+ process()->sendSync(Messages::WebPage::GetFocusedSubFrameRect(), Messages::WebPage::GetFocusedSubFrameRect::Reply(focusedFrameViewRect, isSubFrameFocused), m_pageID);
+ return isSubFrameFocused;
+}
+
String WebPageProxy::getSelectionText()
{
String ret;
void selectionClearAllSelection(WebCore::Frame* frame);
void scrollContentByCharacter(const WebCore::IntPoint&, int direction, bool& result);
void scrollContentByLine(const WebCore::IntPoint&, int direction, bool& result);
+ void getFocusedSubFrameRect(WebCore::IntRect&, bool&);
#endif
#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
SelectionRangeClear() -> (bool result)
ScrollContentByCharacter(WebCore::IntPoint point, int direction) -> (bool result)
ScrollContentByLine(WebCore::IntPoint point, int direction) -> (bool result)
+ GetFocusedSubFrameRect() -> (WebCore::IntRect focusedFrameViewRect, bool isSubFrameFocused)
#endif
#if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
#include "htmlediting.h"
+#include "RenderIFrame.h"
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)
focusedFrame->selection()->modify(FrameSelection::AlterationMove, DirectionForward, LineGranularity, UserTriggered);
}
}
+
+void WebPage::getFocusedSubFrameRect(IntRect& focusedFrameRect, bool& isFocusedSubFrame)
+{
+ isFocusedSubFrame = false;
+
+ Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame();
+ if (!focusedFrame)
+ return;
+
+ if (focusedFrame != m_page->mainFrame()) {
+ FrameView* frameView = focusedFrame->view();
+ HTMLFrameOwnerElement* ownerElement = focusedFrame->ownerElement();
+
+ if (!frameView)
+ return;
+
+ if (ownerElement && ownerElement->hasTagName(HTMLNames::iframeTag)){
+ RenderIFrame* renderIframe = static_cast<RenderIFrame*>(ownerElement->renderer());
+ if (renderIframe) {
+ focusedFrameRect = renderIframe->windowClipRect();
+ isFocusedSubFrame = true;
+ }
+ }
+ }
+}
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)