class ChildThreadDOMData : public DOMData {
public:
ChildThreadDOMData();
+#if PLATFORM(ANDROID)
virtual ~ChildThreadDOMData() { }
+#endif
DOMDataStore& getStore();
class DOMData : public Noncopyable {
public:
DOMData();
+#if PLATFORM(ANDROID)
virtual ~DOMData() { }
+#endif
static DOMData* getCurrent();
static DOMData* getCurrentMainThread(); // Caller must be on the main thread.
#include "TextMetrics.h"
#include "TimeRanges.h"
#include "TreeWalker.h"
+#include "XSLTProcessor.h"
#include "V8AbstractEventListener.h"
#include "V8CustomEventListener.h"
#include "V8DOMWindow.h"
#include "V8LazyEventListener.h"
#include "V8NodeFilterCondition.h"
#include "ValidityState.h"
-#include "VoidCallback.h"
#include "WebKitAnimationEvent.h"
#include "WebKitCSSKeyframeRule.h"
#include "WebKitCSSKeyframesRule.h"
#include "XPathExpression.h"
#include "XPathNSResolver.h"
#include "XPathResult.h"
-#include "XSLTProcessor.h"
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "DOMApplicationCache.h"
#include "V8SVGPODTypeWrapper.h"
#endif // SVG
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(TOUCH_EVENTS) // Android
#include "Touch.h"
#include "TouchList.h"
#include "TouchEvent.h"
#include "V8HTMLTitleElement.h"
#include "V8HTMLUListElement.h"
#include "V8ImageData.h"
+#if !PLATFORM(ANDROID)
+#include "V8InspectorBackend.h"
+#endif
#include "V8Media.h"
#include "V8MediaList.h"
#include "V8MessageChannel.h"
#include "V8XMLHttpRequestUpload.h"
#include "V8XMLSerializer.h"
#include "V8RGBColor.h"
-#include "V8VoidCallback.h"
-
-#if !PLATFORM(ANDROID)
-#include "V8InspectorBackend.h"
-#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "V8DOMApplicationCache.h"
#endif
-#if ENABLE(DATABASE)
-#include "V8Database.h"
-#include "V8SQLError.h"
-#include "V8SQLResultSet.h"
-#include "V8SQLResultSetRowList.h"
-#include "V8SQLTransaction.h"
-#endif
-
#if ENABLE(DOM_STORAGE)
#include "V8Storage.h"
#include "V8StorageEvent.h"
#include "V8SharedWorker.h"
#endif
+#if ENABLE(3D_CANVAS)
+#include "V8CanvasRenderingContext3D.h"
+#include "V8CanvasArrayBuffer.h"
+#include "V8CanvasArray.h"
+#include "V8CanvasByteArray.h"
+#include "V8CanvasBuffer.h"
+#include "V8CanvasFloatArray.h"
+#include "V8CanvasFramebuffer.h"
+#include "V8CanvasIntArray.h"
+#include "V8CanvasProgram.h"
+#include "V8CanvasRenderbuffer.h"
+#include "V8CanvasShader.h"
+#include "V8CanvasShortArray.h"
+#include "V8CanvasTexture.h"
+#include "V8CanvasUnsignedByteArray.h"
+#include "V8CanvasUnsignedIntArray.h"
+#include "V8CanvasUnsignedShortArray.h"
+#endif
+
+#if PLATFORM(ANDROID)
+// TODO: Upstream these guards to webkit.org
+#if ENABLE(DATABASE)
+#include "V8Database.h"
+#include "V8SQLError.h"
+#include "V8SQLResultSet.h"
+#include "V8SQLResultSetRowList.h"
+#include "V8SQLTransaction.h"
+#endif
+
#if ENABLE(GEOLOCATION)
#include "V8Coordinates.h"
#include "V8Geolocation.h"
#include "V8XSLTProcessor.h"
#endif
-#if ENABLE(3D_CANVAS)
-#include "V8CanvasRenderingContext3D.h"
-#include "V8CanvasArrayBuffer.h"
-#include "V8CanvasArray.h"
-#include "V8CanvasByteArray.h"
-#include "V8CanvasBuffer.h"
-#include "V8CanvasFloatArray.h"
-#include "V8CanvasFramebuffer.h"
-#include "V8CanvasIntArray.h"
-#include "V8CanvasProgram.h"
-#include "V8CanvasRenderbuffer.h"
-#include "V8CanvasShader.h"
-#include "V8CanvasShortArray.h"
-#include "V8CanvasTexture.h"
-#include "V8CanvasUnsignedByteArray.h"
-#include "V8CanvasUnsignedIntArray.h"
-#include "V8CanvasUnsignedShortArray.h"
-#endif
+#include "V8VoidCallback.h"
+#endif // PLATFORM(ANDROID)
namespace WebCore {
V(CANVASPIXELARRAY, CanvasPixelArray) \
V(KEYBOARDEVENT, KeyboardEvent) \
V(LOCATION, Location) \
- V(MEDIA, Media) \
+ V(MEDIA, Media) \
V(MEDIALIST, MediaList)
#define DOM_OBJECT_TYPES_2(V) \
V(TREEWALKER, TreeWalker) \
V(UIEVENT, UIEvent) \
V(VALIDITYSTATE, ValidityState) \
- V(VOIDCALLBACK, VoidCallback) \
V(WEBKITANIMATIONEVENT, WebKitAnimationEvent) \
V(WEBKITCSSKEYFRAMERULE, WebKitCSSKeyframeRule) \
V(WEBKITCSSKEYFRAMESRULE, WebKitCSSKeyframesRule) \
SHARED_WORKER_NONNODE_WRAPPER_TYPES(V) \
WORKER_NONNODE_WRAPPER_TYPES(V)
-#if ENABLE(XPATH)
-#define DOM_OBJECT_XPATH_TYPES(V) \
- V(XPATHEVALUATOR, XPathEvaluator) \
- V(XPATHEXCEPTION, XPathException) \
- V(XPATHEXPRESSION, XPathExpression) \
- V(XPATHNSRESOLVER, XPathNSResolver) \
- V(XPATHRESULT, XPathResult)
-#else
-#define DOM_OBJECT_XPATH_TYPES(V)
-#endif
-
-#if ENABLE(XSLT)
-#define DOM_OBJECT_XSLT_TYPES(V) \
- V(XSLTPROCESSOR, XSLTProcessor)
-#else
-#define DOM_OBJECT_XSLT_TYPES(V)
-#endif
-
#if ENABLE(DATABASE)
#define DOM_OBJECT_DATABASE_TYPES(V) \
V(DATABASE, Database) \
#define DOM_OBJECT_WORKERS_TYPES(V)
#endif
-#if ENABLE(GEOLOCATION)
-#define DOM_OBJECT_GEOLOCATION_TYPES(V) \
- V(COORDINATES, Coordinates) \
- V(GEOLOCATION, Geolocation) \
- V(GEOPOSITION, Geoposition) \
- V(POSITIONERROR, PositionError)
-#else
-#define DOM_OBJECT_GEOLOCATION_TYPES(V)
-#endif
-
#if ENABLE(3D_CANVAS)
#define DOM_OBJECT_3D_CANVAS_TYPES(V) \
V(CANVASARRAY, CanvasArray) \
#define DOM_OBJECT_TOUCH_EVENT_TYPES(V)
#endif
-#if PLATFORM(CHROMIUM)
+#if ENABLE(XPATH)
+#define DOM_OBJECT_XPATH_TYPES(V) \
+ V(XPATHEVALUATOR, XPathEvaluator) \
+ V(XPATHEXCEPTION, XPathException) \
+ V(XPATHEXPRESSION, XPathExpression) \
+ V(XPATHNSRESOLVER, XPathNSResolver) \
+ V(XPATHRESULT, XPathResult)
+#else
+#define DOM_OBJECT_XPATH_TYPES(V)
+#endif
+
+#if ENABLE(XSLT)
+#define DOM_OBJECT_XSLT_TYPES(V) \
+ V(XSLTPROCESSOR, XSLTProcessor)
+#else
+#define DOM_OBJECT_XSLT_TYPES(V)
+#endif
+
+#if ENABLE(GEOLOCATION)
+#define DOM_OBJECT_GEOLOCATION_TYPES(V) \
+ V(COORDINATES, Coordinates) \
+ V(GEOLOCATION, Geolocation) \
+ V(GEOPOSITION, Geoposition) \
+ V(POSITIONERROR, PositionError)
+#else
+#define DOM_OBJECT_GEOLOCATION_TYPES(V)
+#endif
+
+#if !PLATFORM(ANDROID)
+#define DOM_OBJECT_INSPECTOR_TYPES(V) \
+ V(INSPECTORBACKEND, InspectorBackend)
+#else
+#define DOM_OBJECT_INSPECTOR_TYPES(V)
+#endif
+
+#if PLATFORM(ANDROID)
+#define DOM_OBJECT_VOIDCALLBACK_TYPES(V) \
+ V(VOIDCALLBACK, VoidCallback)
+#else
+#define DOM_OBJECT_VOIDCALLBACK_TYPES(V)
+#endif
+
+#if PLATFORM(ANDROID)
+// This block is modified, but is not Android-specific.
#define DOM_OBJECT_TYPES(V) \
DOM_OBJECT_TYPES_1(V) \
DOM_OBJECT_TYPES_2(V) \
DOM_OBJECT_3D_CANVAS_TYPES(V) \
DOM_OBJECT_XPATH_TYPES(V) \
DOM_OBJECT_XSLT_TYPES(V) \
- V(INSPECTORBACKEND, InspectorBackend)
-#elif PLATFORM(ANDROID)
-#define DOM_OBJECT_TYPES(V) \
- DOM_OBJECT_TYPES_1(V) \
- DOM_OBJECT_TYPES_2(V) \
- DOM_OBJECT_DATABASE_TYPES(V) \
DOM_OBJECT_GEOLOCATION_TYPES(V) \
- DOM_OBJECT_STORAGE_TYPES(V) \
DOM_OBJECT_TOUCH_EVENT_TYPES(V) \
- DOM_OBJECT_WORKERS_TYPES(V)
+ DOM_OBJECT_VOIDCALLBACK_TYPES(V) \
+ DOM_OBJECT_INSPECTOR_TYPES(V)
#endif
#if ENABLE(SVG)
#include "V8Proxy.h"
#include "CSSMutableStyleDeclaration.h"
-#include "CString.h"
#include "DateExtension.h"
#include "DOMObjectsInclude.h"
#include "DocumentLoader.h"
#include "V8Index.h"
#include "V8IsolatedWorld.h"
+#include <algorithm>
+#include <utility>
#include <v8.h>
#include <v8-debug.h>
#include <wtf/Assertions.h>
#include "TimeCounter.h"
#endif
+#if PLATFORM(ANDROID)
+#include "CString.h"
+#endif
+
namespace WebCore {
v8::Persistent<v8::Context> V8Proxy::m_utilityContext;
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
#include "config.h"
#include "Document.h"
void updateFocusAppearanceSoon();
void cancelFocusAppearanceUpdate();
-
+
#ifdef ANDROID_MOBILE
void setExtraLayoutDelay(int delay) { mExtraLayoutDelay = delay; }
int extraLayoutDelay() { return mExtraLayoutDelay; }
KURL getURLAttribute(const QualifiedName&) const;
virtual const QualifiedName& imageSourceAttributeName() const;
virtual String target() const { return String(); }
+
virtual void focus(bool restorePreviousSelection = true);
virtual void updateFocusAppearance(bool restorePreviousSelection);
void blur();
Node* HTMLCollection::nextItem() const
{
resetCollectionInfo();
-
+
#ifdef ANDROID_FIX
- // resetCollectionInfo() can set info->current to be 0. If this is the
- // case, we need to go back to the firstItem. Otherwise traverseNextItem
+ // resetCollectionInfo() can set info->current to be 0. If this is the
+ // case, we need to go back to the firstItem. Otherwise traverseNextItem
// will crash.
if (!m_info->current)
return firstItem();
#endif
-
+
// Look for the 'second' item. The first one is currentItem, already given back.
Element* retval = itemAfter(m_info->current);
m_info->current = retval;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle *);
virtual bool appendFormData(FormDataList&, bool);
- virtual int listToOptionIndex(int listIndex) const;
virtual int optionToListIndex(int optionIndex) const;
+ virtual int listToOptionIndex(int listIndex) const;
virtual void reset();
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
+
#include "config.h"
#include "HTMLTokenizer.h"
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::recordNoCounter(android::TimeCounter::ParsingTimeCounter, __FUNCTION__);
#endif
-
+
if (!m_parser->skipMode() && !followingFrameset) {
if (cs) {
if (savedPrependingSrc)
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::start(android::TimeCounter::ParsingTimeCounter);
#endif
-
+
if (!m_executingScript && !state.loadingExtScript()) {
m_src.append(m_pendingSrc);
m_pendingSrc.clear();
}
}
-
#if PRELOAD_SCANNER_ENABLED
if (!m_pendingScripts.isEmpty() && !m_executingScript) {
if (!m_preloadScanner)
return;
}
-
#if PRELOAD_SCANNER_ENABLED
if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
m_preloadScanner->end();
class DocumentLoader;
class GraphicsContext;
class HitTestResult;
+#if !PLATFORM(ANDROID)
+class InspectorBackend;
+#endif
class InspectorClient;
class InspectorDOMAgent;
class InspectorFrontend;
class InspectorDOMStorageResource;
class InspectorResource;
-#if !PLATFORM(ANDROID)
-class InspectorBackend;
-class InspectorFrontend;
-#endif
-
class InspectorController
#if ENABLE(JAVASCRIPT_DEBUGGER)
: JavaScriptDebugListener
Page* m_inspectedPage;
InspectorClient* m_client;
+ OwnPtr<InspectorFrontend> m_frontend;
RefPtr<InspectorDOMAgent> m_domAgent;
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
ScriptObject m_injectedScriptObj;
bool m_resourceTrackingEnabled;
bool m_resourceTrackingSettingsLoaded;
#if !PLATFORM(ANDROID)
- OwnPtr<InspectorFrontend> m_frontend;
RefPtr<InspectorBackend> m_inspectorBackend;
#endif
HashMap<String, ScriptValue> m_idToWrappedObject;
#include <stdio.h>
#include <wtf/CurrentTime.h>
-
using namespace std;
namespace WebCore {
}
checkForReload(fullURL);
+
CachedResource* resource = cache()->requestResource(this, type, fullURL, charset, isPreload);
if (resource) {
// Check final URL of resource to catch redirects.
if (Page* page = m_frame->page())
page->progress()->progressCompleted(m_frame);
-
+
#ifdef ANDROID_INSTRUMENT
if (!m_frame->tree()->parent() && m_frame->document()->renderArena())
android::TimeCounter::report(m_URL, cache()->getLiveSize(), cache()->getDeadSize(),
void setupForReplace();
void setupForReplaceByMIMEType(const String& newMIMEType);
-
void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*);
void loadFrameRequest(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest and loadURL.
RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? 0 : m_newestCache;
setNewestCache(m_cacheBeingUpdated.release());
-
if (cacheStorage().storeNewestCache(this)) {
// New cache stored, now remove the old cache.
if (oldNewestCache)
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
#include "config.h"
#include "Frame.h"
page()->focusController()->setFocusedFrame(0);
script()->clearWindowShell();
-
script()->clearScriptObjects();
script()->updatePlatformScriptObjects();
return chrome->runBeforeUnloadConfirmPanel(text, this);
}
-
void Frame::scheduleClose()
{
if (!shouldClose())
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
#include "config.h"
#include "FrameView.h"
[Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
[Custom] long watchPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
+
void clearWatch(in long watchId);
};
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
AtomicString::init();
-#ifdef ANDROID_META_SUPPORT
+#ifdef ANDROID_META_SUPPORT
resetMetadataSettings();
#endif
}
int width = value.toInt();
if (width <= 10000) {
if (width <= 320) {
- // This is a hack to accommodate the pages designed for the
- // original iPhone. The new version, since 10/2007, is to
- // use device-width which works for both portrait and
+ // This is a hack to accommodate the pages designed for the
+ // original iPhone. The new version, since 10/2007, is to
+ // use device-width which works for both portrait and
// landscape modes.
m_viewport_width = 0;
} else {
} else if (key == "telephone") {
if (value == "no") {
m_format_detection_telephone = false;
- }
+ }
} else if (key == "address") {
if (value == "no") {
m_format_detection_address = false;
- }
+ }
} else if (key == "email") {
if (value == "no") {
m_format_detection_email = false;
- }
+ }
} else if (key == "format-detection") {
- // even Apple doc says "format-detection" should be the name of the
- // <meta> tag. In the real world, e.g. amazon.com, use
+ // even Apple doc says "format-detection" should be the name of the
+ // <meta> tag. In the real world, e.g. amazon.com, use
// "format-detection=no" in the "viewport" <meta> tag to disable all
// format detection.
if (value == "no") {
m_format_detection_telephone = false;
m_format_detection_address = false;
m_format_detection_email = false;
- }
+ }
}
}
#endif
bool useWideViewport() const { return m_useWideViewport; }
void setUseWideViewport(bool use) { m_useWideViewport = use; }
#endif
-
+
void setSerifFontFamily(const AtomicString&);
const AtomicString& serifFontFamily() const { return m_serifFontFamily; }
#include "RenderObject.h"
#include "npruntime_impl.h"
#include "Settings.h"
+#include <wtf/ASCIICType.h>
+
#if defined(ANDROID_PLUGINS)
#include "TouchEvent.h"
#endif
#include "runtime.h"
#include <runtime/JSLock.h>
#include <runtime/JSValue.h>
-#endif
-
-#include <wtf/ASCIICType.h>
-#if USE(JSC)
using JSC::ExecState;
using JSC::JSLock;
using JSC::JSObject;
void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect& rect)
{
static RefPtr<Image> nullPluginImage;
- if (!nullPluginImage) {
+ if (!nullPluginImage)
nullPluginImage = Image::loadPlatformResource("nullPlugin");
- }
IntRect imageRect(frameRect().x(), frameRect().y(), nullPluginImage->width(), nullPluginImage->height());
imageRect.move(xOffset, yOffset);
- if (!rect.intersects(imageRect)) {
+ if (!rect.intersects(imageRect))
return;
- }
context->save();
context->clip(windowClipRect());
if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent))
return MozillaUserAgent;
#endif
+
if (m_userAgent.isNull())
m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8();
+
return m_userAgent.data();
}
void AutoTableLayout::layout()
{
-#ifdef ANDROID_LAYOUT
+#ifdef ANDROID_LAYOUT
if (m_table->isSingleColumn())
return;
-#endif
+#endif
// table layout based on the values collected in the layout structure.
int tableWidth = m_table->width() - m_table->bordersPaddingAndSpacing();
int available = tableWidth;
updateScrollInfoAfterLayout();
#ifdef ANDROID_FIX
- // iframe flatten will call FrameView::layout() which calls performPostLayoutTasks,
+ // iframe flatten will call FrameView::layout() which calls performPostLayoutTasks,
// which may make us need to layout again
if (!posChildNeedsLayout() || normalChildNeedsLayout() || selfNeedsLayout())
return false;
// style from this RenderBlock.
RenderBlock* createAnonymousBlock(bool isFlexibleBox = false) const;
- Vector<IntRect>* columnRects() const;
- int columnGap() const;
-
protected:
int maxTopPosMargin() const { return m_maxMargin ? m_maxMargin->m_topPos : MaxMargin::topPosDefault(this); }
int maxTopNegMargin() const { return m_maxMargin ? m_maxMargin->m_topNeg : MaxMargin::topNegDefault(this); }
int desiredColumnWidth() const;
unsigned desiredColumnCount() const;
+#if PLATFORM(ANDROID)
+public:
+ Vector<IntRect>* columnRects() const;
+private:
+#endif
void setDesiredColumnCountAndWidth(int count, int width);
+#if PLATFORM(ANDROID)
+public:
+ int columnGap() const;
+private:
+#endif
void paintContinuationOutlines(PaintInfo&, int tx, int ty);
EFloat cssfloat = style()->floating();
doTextWrap = autowrap && !positioned &&
(((dir == LTR && cssfloat != FRIGHT) ||
- (dir == RTL && cssfloat != FLEFT)) &&
+ (dir == RTL && cssfloat != FLEFT)) &&
((ta == TAAUTO) || (ta == JUSTIFY) ||
((ta == LEFT || ta == WEBKIT_LEFT) && (dir == LTR)) ||
((ta == RIGHT || ta == WEBKIT_RIGHT) && (dir == RTL))));
break;
}
if (obj->isFloating() || obj->isPositioned()) {
- // floating and absolute or fixed positioning are done out
+ // floating and absolute or fixed positioning are done out
// of normal flow. Don't need to worry about height any more.
break;
}
}
}
#endif
-
+
if (isPositioned()) {
calcAbsoluteHorizontal();
return;
if (treatAsReplaced)
#endif
setWidth(max(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth()));
+
#ifdef ANDROID_LAYOUT
// in SSR mode with replaced box, if the box width is wider than the container width,
// it will be shrinked to fit to the container.
- if (containerWidth && (width() + m_marginLeft + m_marginRight) > containerWidth &&
+ if (containerWidth && (width() + m_marginLeft + m_marginRight) > containerWidth &&
document()->frame()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) {
m_marginLeft = m_marginRight = 0;
setWidth(containerWidth);
}
#ifdef ANDROID_LAYOUT
// in SSR mode with non-replaced box, we use ANDROID_SSR_MARGIN_PADDING for left/right margin.
- // If the box width is wider than the container width, it will be shrinked to fit to the container.
- if (containerWidth && !treatAsReplaced &&
+ // If the box width is wider than the container width, it will be shrinked to fit to the container.
+ if (containerWidth && !treatAsReplaced &&
document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) {
setWidth(width() + m_marginLeft + m_marginRight);
m_marginLeft = m_marginLeft > ANDROID_SSR_MARGIN_PADDING ? ANDROID_SSR_MARGIN_PADDING : m_marginLeft;
if (widget() && widget()->isFrameView()) {
FrameView* view = static_cast<FrameView*>(widget());
RenderView* root = NULL;
- if (view->frame() && view->frame()->document() &&
+ if (view->frame() && view->frame()->document() &&
view->frame()->document()->renderer() &&
view->frame()->document()->renderer()->isRenderView())
root = static_cast<RenderView*>(view->frame()->document()->renderer());
child = (RenderBox*)firstChild();
yPos = 0;
#endif // FLATTEN_FRAMESET
-
+
for (int r = 0; r < rows; r++) {
int xPos = 0;
int height = m_rows.m_sizes[r];
#ifdef FLATTEN_FRAMESET
void setGridNeedsLayout() { m_gridCalculated = false; }
#endif
-
+
private:
static const int noSplit = -1;
}
return width;
#else
- return max(minW, min(width, maxW));
+ return max(minW, min(width, maxW));
#endif
}
#ifdef ANDROID_LAYOUT
height = max(minH, min(height, maxH));
// in SSR mode, we will fit the image to its container width
- if (height && document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) {
+ if (height && document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) {
int width;
if (isWidthSpecified())
width = calcReplacedWidthUsing(style()->width());
else
width = calcAspectRatioWidth();
int minW = calcReplacedWidthUsing(style()->minWidth());
- int maxW = style()->maxWidth().value() == undefinedLength ? width :
- calcReplacedWidthUsing(style()->maxWidth());
+ int maxW = style()->maxWidth().value() == undefinedLength ? width :
+ calcReplacedWidthUsing(style()->maxWidth());
width = max(minW, min(width, maxW));
int cw = containingBlockWidthForContent();
- if (cw && width && width>cw)
+ if (cw && width && width > cw)
height = cw * height / width; // preserve aspect ratio
}
return height;
, m_borderRight(0)
{
#ifdef ANDROID_LAYOUT
- m_singleColumn = false;
-#endif
+ m_singleColumn = false;
+#endif
m_columnPos.fill(0, 2);
m_columns.fill(ColumnStruct(), 1);
}
}
}
#endif
-
+
if (isPositioned())
calcAbsoluteHorizontal();
// in SSR mode, we ignore left/right margin for table
if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR)
return;
-#endif
+#endif
calcHorizontalMargins(style()->marginLeft(), style()->marginRight(), availableWidth);
}
bool relayoutChildren = false;
int oldVisibleWidth = m_visibleWidth;
#endif
-
+
int oldWidth = width();
calcWidth();
#ifdef ANDROID_LAYOUT
if (oldVisibleWidth != m_visibleWidth
- && document()->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen)
+ && document()->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen)
relayoutChildren = true;
else if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) {
// if the width of a table is wider than its container width, or it has a nested table,
}
if (shouldRenderAsSingleColumn) {
- m_singleColumn = true;
+ m_singleColumn = true;
if (width() > cw)
setWidth(cw);
if (m_minPrefWidth > cw)
if (view()->frameView()) {
const Settings* settings = document()->settings();
ASSERT(settings);
- if (settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) {
+ if (settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen)
visibleWidth = view()->frameView()->screenWidth();
- }
}
#endif
-
+
for (int i = 0; i < m_gridRows; i++) {
Row& row = *m_grid[i].row;
int cols = row.size();
endCol++;
}
int w = columnPos[endCol] - columnPos[j] - table()->hBorderSpacing();
-#ifdef ANDROID_LAYOUT
- if (table()->isSingleColumn())
- w = table()->width()-(table()->borderLeft()+table()->borderRight()+
- (table()->collapseBorders()?0:(table()->paddingLeft()+table()->paddingRight()+
- 2*table()->hBorderSpacing())));
-#endif
+#ifdef ANDROID_LAYOUT
+ if (table()->isSingleColumn()) {
+ int b = table()->collapseBorders() ?
+ 0 : table()->paddingLeft() + table()->paddingRight() + 2 * table()->hBorderSpacing();
+ w = table()->width() - (table()->borderLeft() + table()->borderRight() + b);
+ }
+#endif
int oldWidth = cell->width();
#ifdef ANDROID_LAYOUT
if (w != oldWidth || (visibleWidth > 0 && visibleWidth != cell->getVisibleWidth())) {
#ifdef ANDROID_LAYOUT
if (table()->isSingleColumn())
return m_rowPos[m_gridRows];
-#endif
+#endif
RenderTableCell* cell;
int hspacing = table()->hBorderSpacing();
int vspacing = table()->vBorderSpacing();
int rHeight = vspacing;
-
+
int leftOffset = hspacing;
-
+
int nEffCols = table()->numEffCols();
for (int r = 0; r < totalRows; r++) {
for (int c = 0; c < nEffCols; c++) {
CellStruct current = cellAt(r, c);
RenderTableCell* cell = current.cell;
-
+
if (!cell || current.inColSpan)
continue;
if (r > 0 && (cellAt(r-1, c).cell == cell))
continue;
-
+
// cell->setCellTopExtra(0);
// cell->setCellBottomExtra(0);
-
+
int oldCellX = cell->x();
int oldCellY = cell->y();
-
+
if (style()->direction() == RTL) {
cell->setX(table()->width());
cell->setY(rHeight);
rHeight += cell->height() + vspacing;
}
}
-
+
setHeight(rHeight);
return height();
}
unsigned int startcol = 0;
unsigned int endcol = totalCols;
if (table()->isSingleColumn()) {
- // FIXME: should we be smarter too?
+ // FIXME: should we be smarter too?
} else {
// FIXME: possible to rollback to the common tree.
// rowPos size is set in calcRowHeight(), which is called from table layout().
if (!row->hasSelfPaintingLayer())
cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row);
}
+
if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
cell->paint(paintInfo, tx, ty);
}
String RenderTextControl::finishText(Vector<UChar>& result) const
{
- // ANDROID: This method was modified with a fix from WebKit r31081. This
- // comment can be removed the next time we update.
-
// Remove one trailing newline; there's always one that's collapsed out by rendering.
size_t size = result.size();
if (size && result[size - 1] == '\n')
m_minPrefWidth += toAdd;
m_maxPrefWidth += toAdd;
+#if !PLATFORM(ANDROID)
// FIXME: This causes cnn.com loading way slow. Comment it out for now
-//#ifdef ANDROID_LAYOUT
-#if 0
Frame* frame = document()->frame();
if (frame && frame->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) {
int maxWidth = frame->view()->visibleWidth() - 2 * ANDROID_FCTS_MARGIN_PADDING;
case '-':
case '?':
#ifdef ANDROID_LAYOUT
- // as '/' is used in uri which is always long, we would like to break it
+ // as '/' is used in uri which is always long, we would like to break it
case '/':
#endif
case softHyphen: