summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/JavaScriptCore/wtf/Platform.h2
-rw-r--r--Source/WebCore/dom/Document.cpp3
-rw-r--r--Source/WebCore/dom/Document.h8
-rw-r--r--Source/WebCore/dom/Element.cpp20
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLTextAreaElement.cpp2
-rw-r--r--Source/WebCore/platform/android/PlatformBridge.h2
-rw-r--r--Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp73
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp3
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.h4
-rw-r--r--Source/WebCore/platform/graphics/android/layers/MediaLayer.h1
-rw-r--r--Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h3
-rw-r--r--Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp4
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp15
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h8
15 files changed, 31 insertions, 123 deletions
diff --git a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h
index 5ac08d1..41850ee 100644
--- a/Source/JavaScriptCore/wtf/Platform.h
+++ b/Source/JavaScriptCore/wtf/Platform.h
@@ -780,8 +780,6 @@
#define ANDROID_ANIMATED_GIF
// apple-touch-icon support in <link> tags
#define ANDROID_APPLE_TOUCH_ICON
-// track changes to the style that may change what is drawn
-#define ANDROID_STYLE_VERSION
// This is present in JavaScriptCore/config.h, which Android does not use.
#define WTF_CHANGES 1
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index b6a1393..96be3fb 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -387,9 +387,6 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
, m_compatibilityMode(NoQuirksMode)
, m_compatibilityModeLocked(false)
, m_domTreeVersion(++s_globalTreeVersion)
-#ifdef ANDROID_STYLE_VERSION
- , m_styleVersion(0)
-#endif
, m_styleSheets(StyleSheetList::create(this))
, m_readyState(Complete)
, m_styleRecalcTimer(this, &Document::styleRecalcTimerFired)
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index ce82b2e..c4ccb9c 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -905,11 +905,6 @@ public:
void incDOMTreeVersion() { m_domTreeVersion = ++s_globalTreeVersion; }
uint64_t domTreeVersion() const { return m_domTreeVersion; }
-#ifdef ANDROID_STYLE_VERSION
- void incStyleVersion() { ++m_styleVersion; }
- unsigned styleVersion() const { return m_styleVersion; }
-#endif
-
void setDocType(PassRefPtr<DocumentType>);
#if ENABLE(XPATH)
@@ -1223,9 +1218,6 @@ private:
uint64_t m_domTreeVersion;
static uint64_t s_globalTreeVersion;
-#ifdef ANDROID_STYLE_VERSION
- unsigned m_styleVersion;
-#endif
HashSet<NodeIterator*> m_nodeIterators;
HashSet<Range*> m_ranges;
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 64d3eed..5fb6cdc 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -1069,21 +1069,6 @@ bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS
return false;
}
-#ifdef ANDROID_STYLE_VERSION
-static bool displayDiff(const RenderStyle* s1, const RenderStyle* s2)
-{
- if (!s1 && !s2)
- return false;
- else if ((!s1 && s2) || (s1 && !s2))
- return true;
-
- return s1->display() != s2->display()
- || s1->left() != s2->left() || s1->top() != s2->top()
- || s1->right() != s2->right() || s1->bottom() != s2->bottom()
- || s1->width() != s2->width() || s1->height() != s2->height();
-}
-#endif
-
void Element::recalcStyle(StyleChange change)
{
// Ref currentStyle in case it would otherwise be deleted when setRenderStyle() is called.
@@ -1092,11 +1077,6 @@ void Element::recalcStyle(StyleChange change)
bool hasDirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByDirectAdjacentRules();
if ((change > NoChange || needsStyleRecalc())) {
-#ifdef ANDROID_STYLE_VERSION
- RefPtr<RenderStyle> newStyle = document()->styleForElementIgnoringPendingStylesheets(this);
- if (displayDiff(currentStyle.get(), newStyle.get()))
- document()->incStyleVersion();
-#endif
if (hasRareData())
rareData()->resetComputedStyle();
}
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 36cdf51..4ede2a8 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -444,10 +444,6 @@ void HTMLInputElement::setType(const String& type)
void HTMLInputElement::updateType()
{
OwnPtr<InputType> newType = InputType::create(this, fastGetAttribute(typeAttr));
-#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
- if (newType->isPasswordField() && document()->focusedNode() == this)
- PlatformBridge::updateTextfield(document()->view(), this, true, String());
-#endif
bool hadType = m_hasType;
m_hasType = true;
if (m_inputType->formControlType() == newType->formControlType())
@@ -912,7 +908,7 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
unsigned max = m_data.value().length();
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
// Make sure our UI side textfield changes to match the RenderTextControl
- PlatformBridge::updateTextfield(document()->view(), this, false, value);
+ PlatformBridge::updateTextfield(document()->view(), this, value);
#endif
if (document()->focusedNode() == this)
InputElement::updateSelectionRange(this, this, max, max);
diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp
index 5b12a14..50471d1 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.cpp
+++ b/Source/WebCore/html/HTMLTextAreaElement.cpp
@@ -329,7 +329,7 @@ void HTMLTextAreaElement::setValueCommon(const String& value)
if (document()->focusedNode() == this) {
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
// Make sure our UI side textfield changes to match the RenderTextControl
- PlatformBridge::updateTextfield(document()->view(), this, false, value);
+ PlatformBridge::updateTextfield(document()->view(), this, value);
#endif
unsigned endOfString = m_value.length();
setSelectionRange(endOfString, endOfString);
diff --git a/Source/WebCore/platform/android/PlatformBridge.h b/Source/WebCore/platform/android/PlatformBridge.h
index e48e50c..5af5d2d 100644
--- a/Source/WebCore/platform/android/PlatformBridge.h
+++ b/Source/WebCore/platform/android/PlatformBridge.h
@@ -132,7 +132,7 @@ public:
// Update the viewport meta data.
static void updateViewport(FrameView*);
- static void updateTextfield(FrameView*, Node*, bool changeToPassword, const WTF::String& text);
+ static void updateTextfield(FrameView*, Node*, const WTF::String& text);
static void setScrollPosition(ScrollView*, int x, int y);
diff --git a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
index 869c7b6..d59674b 100644
--- a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
@@ -463,8 +463,7 @@ public:
private:
void setupFontForScriptRun();
- const FontPlatformData* setupComplexFont(FallbackScripts script,
- const FontPlatformData& platformData);
+ const FontPlatformData* setupComplexFont(HB_Script script, const FontPlatformData& platformData);
HB_FontRec* allocHarfbuzzFont();
void deleteGlyphArrays();
void createGlyphArrays(int);
@@ -660,8 +659,7 @@ void TextRunWalker::setWordAndLetterSpacing(int wordSpacingAdjustment,
}
const FontPlatformData* TextRunWalker::setupComplexFont(
- FallbackScripts script,
- const FontPlatformData& platformData)
+ HB_Script script, const FontPlatformData& platformData)
{
static FallbackHash fallbackPlatformData;
@@ -671,15 +669,19 @@ const FontPlatformData* TextRunWalker::setupComplexFont(
// italic, then bold italic. additional fake style bits can be added.
int scriptStyleIndex = script;
if (platformData.isFakeBold())
- scriptStyleIndex += kFallbackScriptNumber;
+ scriptStyleIndex += HB_ScriptCount;
if (platformData.isFakeItalic())
- scriptStyleIndex += kFallbackScriptNumber << 1;
+ scriptStyleIndex += HB_ScriptCount << 1;
FallbackFontKey key(scriptStyleIndex, platformData.size());
FontPlatformData* newPlatformData = 0;
if (!fallbackPlatformData.contains(key)) {
- SkTypeface* typeface = SkCreateTypefaceForScript(script);
+ SkTypeface::Style currentStyle = SkTypeface::kNormal;
+ if (platformData.typeface())
+ currentStyle = platformData.typeface()->style();
+ SkTypeface* typeface = SkCreateTypefaceForScript(script, currentStyle,
+ SkPaint::kElegant_Variant);
newPlatformData = new FontPlatformData(platformData, typeface);
SkSafeUnref(typeface);
fallbackPlatformData.set(key, newPlatformData);
@@ -697,61 +699,8 @@ void TextRunWalker::setupFontForScriptRun()
const FontData* fontData = m_font->glyphDataForCharacter(m_run[0], false).fontData;
const FontPlatformData& platformData =
fontData->fontDataForCharacter(' ')->platformData();
- const FontPlatformData* complexPlatformData = &platformData;
-
- switch (m_item.item.script) {
- case HB_Script_Bengali:
- complexPlatformData = setupComplexFont(kBengali_FallbackScript, platformData);
- break;
- case HB_Script_Devanagari:
- complexPlatformData = setupComplexFont(kDevanagari_FallbackScript, platformData);
- break;
- case HB_Script_Hebrew:
- switch (platformData.typeface()->style()) {
- case SkTypeface::kBold:
- case SkTypeface::kBoldItalic:
- complexPlatformData = setupComplexFont(kHebrewBold_FallbackScript, platformData);
- break;
- case SkTypeface::kNormal:
- case SkTypeface::kItalic:
- default:
- complexPlatformData = setupComplexFont(kHebrewRegular_FallbackScript, platformData);
- break;
- }
- break;
- case HB_Script_Kannada:
- complexPlatformData = setupComplexFont(kKannada_FallbackScript, platformData);
- break;
- case HB_Script_Malayalam:
- complexPlatformData = setupComplexFont(kMalayalam_FallbackScript, platformData);
- break;
- case HB_Script_Arabic:
- complexPlatformData = setupComplexFont(kArabic_FallbackScript, platformData);
- break;
- case HB_Script_Tamil:
- switch (platformData.typeface()->style()) {
- case SkTypeface::kBold:
- case SkTypeface::kBoldItalic:
- complexPlatformData = setupComplexFont(kTamilBold_FallbackScript, platformData);
- break;
- case SkTypeface::kNormal:
- case SkTypeface::kItalic:
- default:
- complexPlatformData = setupComplexFont(kTamilRegular_FallbackScript, platformData);
- break;
- }
- break;
- case HB_Script_Telugu:
- complexPlatformData = setupComplexFont(kTelugu_FallbackScript, platformData);
- break;
- case HB_Script_Thai:
- complexPlatformData = setupComplexFont(kThai_FallbackScript, platformData);
- break;
- default:
- // HB_Script_Common; includes Ethiopic
- complexPlatformData = &platformData;
- break;
- }
+ const FontPlatformData* complexPlatformData = setupComplexFont(m_item.item.script, platformData);
+
m_item.face = complexPlatformData->harfbuzzFace();
m_item.font->userData = const_cast<FontPlatformData*>(complexPlatformData);
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
index dde7e9b..438d96c 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
@@ -289,6 +289,9 @@ void LayerAndroid::addDirtyArea()
IntRect dirtyArea(area.x(), area.y(), area.width(), area.height());
state()->addDirtyArea(dirtyArea);
+
+ for (int i = 0; i < countChildren(); i++)
+ getChild(i)->addDirtyArea();
}
void LayerAndroid::addAnimation(PassRefPtr<AndroidAnimation> prpAnim)
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
index 312ad7b..b28daef 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
@@ -273,7 +273,9 @@ public:
void setIntrinsicallyComposited(bool intCom) { m_intrinsicallyComposited = intCom; }
virtual bool needsIsolatedSurface() {
- return (needsTexture() && m_intrinsicallyComposited) || m_animations.size();
+ return (needsTexture() && m_intrinsicallyComposited)
+ || m_animations.size()
+ || m_imageCRC;
}
int setHwAccelerated(bool hwAccelerated);
diff --git a/Source/WebCore/platform/graphics/android/layers/MediaLayer.h b/Source/WebCore/platform/graphics/android/layers/MediaLayer.h
index 2f39d74..8e04681 100644
--- a/Source/WebCore/platform/graphics/android/layers/MediaLayer.h
+++ b/Source/WebCore/platform/graphics/android/layers/MediaLayer.h
@@ -39,6 +39,7 @@ public:
virtual bool drawGL(bool layerTilesDisabled);
virtual void paintBitmapGL() const { };
virtual bool needsTexture() { return false; }
+ virtual bool needsIsolatedSurface() { return true; }
virtual bool isMedia() const { return true; }
virtual LayerAndroid* copy() const { return new MediaLayer(*this); }
diff --git a/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h
index dd88a85..5ebf615 100644
--- a/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h
@@ -55,9 +55,10 @@ public:
virtual bool isVideo() const { return true; }
virtual LayerAndroid* copy() const { return new VideoLayerAndroid(*this); }
- // The following 3 functions are called in UI thread only.
+ // The following functions are called in UI thread only.
virtual bool drawGL(bool layerTilesDisabled);
void setSurfaceTexture(sp<SurfaceTexture> texture, int textureName, PlayerState playerState);
+ virtual bool needsIsolatedSurface() { return true; }
private:
void init();
diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 56e7e24..864b27d 100644
--- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -164,10 +164,10 @@ void PlatformBridge::updateViewport(FrameView* frameView)
webViewCore->updateViewport();
}
-void PlatformBridge::updateTextfield(FrameView* frameView, Node* nodePtr, bool changeToPassword, const WTF::String& text)
+void PlatformBridge::updateTextfield(FrameView* frameView, Node* nodePtr, const WTF::String& text)
{
android::WebViewCore* webViewCore = android::WebViewCore::getWebViewCore(frameView);
- webViewCore->updateTextfield(nodePtr, changeToPassword, text);
+ webViewCore->updateTextfield(nodePtr, text);
}
void PlatformBridge::setScrollPosition(ScrollView* scrollView, int x, int y) {
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index b9e4ed7..41f706f 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -469,7 +469,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue->m_updateViewport = GetJMethod(env, clazz, "updateViewport", "()V");
m_javaGlue->m_sendNotifyProgressFinished = GetJMethod(env, clazz, "sendNotifyProgressFinished", "()V");
m_javaGlue->m_sendViewInvalidate = GetJMethod(env, clazz, "sendViewInvalidate", "(IIII)V");
- m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V");
+ m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(ILjava/lang/String;I)V");
m_javaGlue->m_updateTextSelection = GetJMethod(env, clazz, "updateTextSelection", "(IIIII)V");
m_javaGlue->m_updateTextSizeAndScroll = GetJMethod(env, clazz, "updateTextSizeAndScroll", "(IIIII)V");
m_javaGlue->m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "()V");
@@ -2989,7 +2989,7 @@ void WebViewCore::passToJs(int generation, const WTF::String& current,
WTF::String test = getInputText(focus);
if (test != current) {
// If the text changed during the key event, update the UI text field.
- updateTextfield(focus, false, test);
+ updateTextfield(focus, test);
}
// Now that the selection has settled down, send it.
updateTextSelection();
@@ -3892,8 +3892,7 @@ void WebViewCore::updateTextSizeAndScroll(WebCore::Node* node)
checkException(env);
}
-void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword,
- const WTF::String& text)
+void WebViewCore::updateTextfield(WebCore::Node* ptr, const WTF::String& text)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
AutoJObject javaObject = m_javaGlue->object(env);
@@ -3901,15 +3900,9 @@ void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword,
return;
if (m_blockTextfieldUpdates)
return;
- if (changeToPassword) {
- env->CallVoidMethod(javaObject.get(), m_javaGlue->m_updateTextfield,
- (int) ptr, true, 0, m_textGeneration);
- checkException(env);
- return;
- }
jstring string = wtfStringToJstring(env, text);
env->CallVoidMethod(javaObject.get(), m_javaGlue->m_updateTextfield,
- (int) ptr, false, string, m_textGeneration);
+ (int) ptr, string, m_textGeneration);
env->DeleteLocalRef(string);
checkException(env);
}
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index 72ccf65..dc58023 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -202,13 +202,9 @@ namespace android {
/**
* Tell the java side to update the focused textfield
* @param pointer Pointer to the node for the input field.
- * @param changeToPassword If true, we are changing the textfield to
- * a password field, and ignore the WTF::String
- * @param text If changeToPassword is false, this is the new text that
- * should go into the textfield.
+ * @param text This is the new text that should go into the textfield.
*/
- void updateTextfield(WebCore::Node* pointer,
- bool changeToPassword, const WTF::String& text);
+ void updateTextfield(WebCore::Node* pointer, const WTF::String& text);
/**
* Tell the java side to update the current selection in the focused