diff --git a/DEPS b/DEPS index 94b7574..d91ec47f 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '7d22a33e219ba8038821b378ab80ed9028723d49', + 'skia_revision': '68ce7ce9ec8ab161dd39352d97e54d9b4367224a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '4137a086a82579f1191177e1c6ea722e03489b03', + 'catapult_revision': 'f7bb286d01fdbedf1f6dd5921d564ef5f0344cb4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -166,7 +166,7 @@ Var('chromium_git') + '/external/github.com/google/snappy.git' + '@' + '8b60aac4fdbbb8f1dcce778accb5c04136c3a908', 'src/tools/gyp': - Var('chromium_git') + '/external/gyp.git' + '@' + 'e7079f0e0e14108ab0dba58728ff219637458563', + Var('chromium_git') + '/external/gyp.git' + '@' + 'eb296f67da078ec01f5e3a9ea9cdc6d26d680161', 'src/tools/swarming_client': Var('chromium_git') + '/external/swarming.client.git' + '@' + Var('swarming_revision'), @@ -241,7 +241,7 @@ Var('chromium_git') + '/external/github.com/open-source-parsers/jsoncpp.git' + '@' + 'f572e8e42e22cfcf5ab0aea26574f408943edfa4', # from svn 248 'src/third_party/libyuv': - Var('chromium_git') + '/libyuv/libyuv.git' + '@' + '8cab2e31d76246263206318f3568d452e7f3ff3e', # from r1651 + Var('chromium_git') + '/libyuv/libyuv.git' + '@' + 'fc02cc3806a394a6b887979ba74aa49955f3199b', # from r1652 'src/third_party/smhasher/src': Var('chromium_git') + '/external/smhasher.git' + '@' + 'e87738e57558e0ec472b2fc3a643b838e5b6e88f',
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index bcd1472..572a8dd 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -723,12 +723,12 @@ Alt+Search or Shift </message> <message name="IDS_ASH_STATUS_TRAY_CAPS_LOCK_CANCEL_BY_ALT_SEARCH" desc="The message shown on a bubble when caps lock is turned on."> - CAPS LOCK is on. - Press Alt+Search or Shift to cancel. +CAPS LOCK is on. +Press Alt+Search or Shift to cancel. </message> <message name="IDS_ASH_STATUS_TRAY_CAPS_LOCK_CANCEL_BY_SEARCH" desc="The message shown on a bubble when caps lock is turned on."> - CAPS LOCK is on. - Press Search or Shift to cancel. +CAPS LOCK is on. +Press Search or Shift to cancel. </message> <message name="IDS_ASH_STATUS_TRAY_BATTERY_FULL" desc="The label in the tray dialog to indicate that the battery is full."> Battery full @@ -953,14 +953,11 @@ <message name="IDS_ASH_QUICK_UNLOCK_NOTIFICATION_BODY" desc="The body of the notification for Quick Unlock feature notification."> QU Feature notification body goes here. QU Feature notification body goes here. QU Feature notification body goes here. QU Feature notification body goes here. QU Feature notification body goes here. </message> - <message name="IDS_ASH_FINGERPRINT_NOTIFICATION_TITLE" desc="The title of the - notification for fingerprint unlock feature notification."> + <message name="IDS_ASH_FINGERPRINT_NOTIFICATION_TITLE" desc="The title of the notification for fingerprint unlock feature notification."> Enable Fingerprint unlock? </message> - <message name="IDS_ASH_FINGERPRINT_NOTIFICATION_BODY" desc="The body of the no - tification for fingerprint unlock feature notification."> - Skip the lock screen by just tapping the fingerprint sensor. Click to config - ure. + <message name="IDS_ASH_FINGERPRINT_NOTIFICATION_BODY" desc="The body of the notification for fingerprint unlock feature notification."> + Skip the lock screen by just tapping the fingerprint sensor. Click to configure. </message> <!-- Deprecated Accelerators Messages -->
diff --git a/ash/system/network/network_icon.cc b/ash/system/network/network_icon.cc index 39eea46..6d94d2a8 100644 --- a/ash/system/network/network_icon.cc +++ b/ash/system/network/network_icon.cc
@@ -436,21 +436,14 @@ return gfx::ImageSkia(source, source->size()); } -// Returns an image to represent either a fully connected/enabled network or a -// disconnected/disabled network. +// Returns an image to represent either a fully connected network or a +// disconnected network. const gfx::ImageSkia GetBasicImage(bool connected, IconType icon_type, const std::string& network_type) { DCHECK_NE(shill::kTypeVPN, network_type); - SignalStrengthImageSource* source = new SignalStrengthImageSource( - ImageTypeForNetworkType(network_type), icon_type, kNumNetworkImages - 1); - gfx::ImageSkia icon = gfx::ImageSkia(source, source->size()); - Badges badges; - if (!connected) { - badges.center = {&kNetworkBadgeOffIcon, - GetDefaultColorForIconType(icon_type)}; - } - return NetworkIconImageSource::CreateImage(icon, badges); + return GetImageForIndex(ImageTypeForNetworkType(network_type), icon_type, + connected ? kNumNetworkImages - 1 : 0); } gfx::ImageSkia* ConnectingWirelessImage(ImageType image_type, @@ -769,12 +762,20 @@ return icon->image(); } -gfx::ImageSkia GetBasicImageForWiFiNetwork(bool connected) { - return GetBasicImage(connected, ICON_TYPE_LIST, shill::kTypeWifi); +gfx::ImageSkia GetImageForWiFiEnabledState(bool enabled, IconType icon_type) { + gfx::ImageSkia image = + GetBasicImage(true /* connected */, icon_type, shill::kTypeWifi); + Badges badges; + if (!enabled) { + badges.center = {&kNetworkBadgeOffIcon, + GetDefaultColorForIconType(icon_type)}; + } + return NetworkIconImageSource::CreateImage(image, badges); } gfx::ImageSkia GetImageForDisconnectedCellNetwork() { - return GetBasicImage(false, ICON_TYPE_LIST, shill::kTypeCellular); + return GetBasicImage(false /* not connected */, ICON_TYPE_LIST, + shill::kTypeCellular); } gfx::ImageSkia GetImageForNewWifiNetwork(SkColor icon_color, @@ -930,8 +931,16 @@ *label = l10n_util::GetStringUTF16(uninitialized_msg); *animating = true; } else { - // Otherwise show the disconnected wifi icon. - *image = GetBasicImage(false, icon_type, shill::kTypeWifi); + // Otherwise show a Wi-Fi icon. If Wi-Fi is disabled, show a full icon + // with a strikethrough. If it's enabled then it's disconnected, so show + // an empty wedge. + bool wifi_enabled = + NetworkHandler::Get()->network_state_handler()->IsTechnologyEnabled( + NetworkTypePattern::WiFi()); + *image = wifi_enabled ? GetBasicImage(false /* not connected */, + icon_type, shill::kTypeWifi) + : GetImageForWiFiEnabledState( + false /* not enabled*/, icon_type); if (label) { *label = l10n_util::GetStringUTF16( IDS_ASH_STATUS_TRAY_NETWORK_NOT_CONNECTED);
diff --git a/ash/system/network/network_icon.h b/ash/system/network/network_icon.h index be5bd48..827cacc 100644 --- a/ash/system/network/network_icon.h +++ b/ash/system/network/network_icon.h
@@ -34,9 +34,11 @@ IconType icon_type); // Gets an image for a Wi-Fi network, either full strength or strike-through -// based on |connected|. +// based on |enabled|. // TODO(estade): Expose SignalStrengthImageSource and use that instead. -ASH_EXPORT gfx::ImageSkia GetBasicImageForWiFiNetwork(bool connected); +ASH_EXPORT gfx::ImageSkia GetImageForWiFiEnabledState( + bool enabled, + IconType = ICON_TYPE_DEFAULT_VIEW); // Gets the disconnected image for a cell network. // TODO(estade): Expose SignalStrengthImageSource and use that instead.
diff --git a/ash/system/network/tray_network.cc b/ash/system/network/tray_network.cc index 297ee10..6dc1e43 100644 --- a/ash/system/network/tray_network.cc +++ b/ash/system/network/tray_network.cc
@@ -28,6 +28,7 @@ #include "third_party/cros_system_api/dbus/service_constants.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/image/image_skia_operations.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/link.h" #include "ui/views/controls/link_listener.h" @@ -141,10 +142,17 @@ gfx::ImageSkia image; base::string16 label; bool animating = false; - // TODO(bruthig): Update the image to use the proper color. See - // https://crbug.com/632027. network_icon::GetDefaultNetworkImageAndLabel( network_icon::ICON_TYPE_DEFAULT_VIEW, &image, &label, &animating); + // We use the inactive icon alpha only if there is no active network and + // wifi is disabled. + if (!IsActive() && + !NetworkHandler::Get()->network_state_handler()->IsTechnologyEnabled( + NetworkTypePattern::WiFi())) { + image = gfx::ImageSkiaOperations::CreateTransparentImage( + image, TrayPopupItemStyle::kInactiveIconAlpha); + } + if (animating) network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); else @@ -163,12 +171,15 @@ std::unique_ptr<TrayPopupItemStyle> HandleCreateStyle() const override { std::unique_ptr<TrayPopupItemStyle> style = TrayItemMore::HandleCreateStyle(); - style->set_color_style(GetConnectedNetwork() != nullptr + style->set_color_style(IsActive() ? TrayPopupItemStyle::ColorStyle::ACTIVE : TrayPopupItemStyle::ColorStyle::INACTIVE); return style; } + // Determines whether to use the ACTIVE or INACTIVE text style. + bool IsActive() const { return GetConnectedNetwork() != nullptr; } + private: DISALLOW_COPY_AND_ASSIGN(NetworkDefaultView); }; @@ -204,11 +215,11 @@ } void Update() override { - bool wifi_enabled = + const bool wifi_enabled = NetworkHandler::Get()->network_state_handler()->IsTechnologyEnabled( NetworkTypePattern::WiFi()); image_view_->SetImage( - network_icon::GetBasicImageForWiFiNetwork(wifi_enabled)); + network_icon::GetImageForWiFiEnabledState(wifi_enabled)); const int string_id = wifi_enabled ? IDS_ASH_STATUS_TRAY_NETWORK_WIFI_ENABLED
diff --git a/ash/system/tray/tray_popup_item_style.cc b/ash/system/tray/tray_popup_item_style.cc index e7a7cd4..fd869f0 100644 --- a/ash/system/tray/tray_popup_item_style.cc +++ b/ash/system/tray/tray_popup_item_style.cc
@@ -14,8 +14,8 @@ namespace ash { namespace { -const int kInactiveAlpha = 0x8A; -const int kDisabledAlpha = 0x61; +constexpr int kInactiveAlpha = TrayPopupItemStyle::kInactiveIconAlpha * 0xFF; +constexpr int kDisabledAlpha = 0x61; } // namespace
diff --git a/ash/system/tray/tray_popup_item_style.h b/ash/system/tray/tray_popup_item_style.h index a58fb02..8d1c5dc 100644 --- a/ash/system/tray/tray_popup_item_style.h +++ b/ash/system/tray/tray_popup_item_style.h
@@ -50,6 +50,8 @@ CAPTION, }; + static constexpr double kInactiveIconAlpha = 0.54; + static SkColor GetIconColor(ColorStyle color_style); explicit TrayPopupItemStyle(FontStyle font_style);
diff --git a/ash/wm/resize_shadow.cc b/ash/wm/resize_shadow.cc index 847ded2..53eba70 100644 --- a/ash/wm/resize_shadow.cc +++ b/ash/wm/resize_shadow.cc
@@ -94,6 +94,10 @@ ReparentLayer(); } +void ResizeShadow::OnWindowStackingChanged(aura::Window* window) { + ReparentLayer(); +} + void ResizeShadow::ShowForHitTest(int hit) { // Don't start animations unless something changed. if (hit == last_hit_test_)
diff --git a/ash/wm/resize_shadow.h b/ash/wm/resize_shadow.h index d9003ab..3ebcf46 100644 --- a/ash/wm/resize_shadow.h +++ b/ash/wm/resize_shadow.h
@@ -32,6 +32,7 @@ const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) override; void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; + void OnWindowStackingChanged(aura::Window* window) override; // Shows resize effects for one or more edges based on a |hit_test| code, such // as HTRIGHT or HTBOTTOMRIGHT.
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index be7d21d..391404f7 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc
@@ -649,7 +649,7 @@ CBU8_APPEND_UNSAFE(code_unit8, offset, code_unit16_high); } - dest_string->append(code_unit8); + dest_string->append(code_unit8, offset); return true; }
diff --git a/base/json/json_reader_unittest.cc b/base/json/json_reader_unittest.cc index 1b00b1d9..8e05cae 100644 --- a/base/json/json_reader_unittest.cc +++ b/base/json/json_reader_unittest.cc
@@ -240,12 +240,12 @@ { // Test hex and unicode escapes including the null character. std::unique_ptr<Value> root = - JSONReader().ReadToValue("\"\\x41\\x00\\u1234\""); + JSONReader().ReadToValue("\"\\x41\\x00\\u1234\\u0000\""); ASSERT_TRUE(root); EXPECT_TRUE(root->IsType(Value::Type::STRING)); std::string str_val; EXPECT_TRUE(root->GetAsString(&str_val)); - EXPECT_EQ(std::wstring(L"A\0\x1234", 3), UTF8ToWide(str_val)); + EXPECT_EQ(std::wstring(L"A\0\x1234\0", 4), UTF8ToWide(str_val)); } {
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h index 86fac9c..2c3d506 100644 --- a/base/mac/sdk_forward_declarations.h +++ b/base/mac/sdk_forward_declarations.h
@@ -187,6 +187,7 @@ @interface NSObject (ElCapitanSDK) - (NSLayoutConstraint*)constraintEqualToConstant:(CGFloat)c; +- (NSLayoutConstraint*)constraintGreaterThanOrEqualToConstant:(CGFloat)c; @end @interface NSView (ElCapitanSDK) @@ -246,6 +247,10 @@ action:(SEL)action; @end +@interface NSApplication (SierraPointOneSDK) +@property BOOL automaticCustomizeTouchBarMenuItemEnabled; +@end + #endif // MAC_OS_X_VERSION_10_12_1 // ----------------------------------------------------------------------------
diff --git a/base/task/cancelable_task_tracker.cc b/base/task/cancelable_task_tracker.cc index e68b959..0d4e57cf 100644 --- a/base/task/cancelable_task_tracker.cc +++ b/base/task/cancelable_task_tracker.cc
@@ -19,33 +19,33 @@ namespace { -void RunIfNotCanceled(const CancellationFlag* flag, const Closure& task) { +void RunIfNotCanceled(const CancellationFlag* flag, OnceClosure task) { if (!flag->IsSet()) - task.Run(); + std::move(task).Run(); } void RunIfNotCanceledThenUntrack(const CancellationFlag* flag, - const Closure& task, - const Closure& untrack) { - RunIfNotCanceled(flag, task); - untrack.Run(); + OnceClosure task, + OnceClosure untrack) { + RunIfNotCanceled(flag, std::move(task)); + std::move(untrack).Run(); } bool IsCanceled(const CancellationFlag* flag, - base::ScopedClosureRunner* cleanup_runner) { + ScopedClosureRunner* cleanup_runner) { return flag->IsSet(); } -void RunAndDeleteFlag(const Closure& closure, const CancellationFlag* flag) { - closure.Run(); +void RunAndDeleteFlag(OnceClosure closure, const CancellationFlag* flag) { + std::move(closure).Run(); delete flag; } -void RunOrPostToTaskRunner(TaskRunner* task_runner, const Closure& closure) { +void RunOrPostToTaskRunner(TaskRunner* task_runner, OnceClosure closure) { if (task_runner->RunsTasksOnCurrentThread()) - closure.Run(); + std::move(closure).Run(); else - task_runner->PostTask(FROM_HERE, closure); + task_runner->PostTask(FROM_HERE, std::move(closure)); } } // namespace @@ -65,21 +65,22 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTask( TaskRunner* task_runner, const tracked_objects::Location& from_here, - const Closure& task) { + OnceClosure task) { DCHECK(sequence_checker_.CalledOnValidSequence()); - return PostTaskAndReply(task_runner, from_here, task, Bind(&base::DoNothing)); + return PostTaskAndReply(task_runner, from_here, std::move(task), + BindOnce(&DoNothing)); } CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply( TaskRunner* task_runner, const tracked_objects::Location& from_here, - Closure task, - Closure reply) { + OnceClosure task, + OnceClosure reply) { DCHECK(sequence_checker_.CalledOnValidSequence()); // We need a SequencedTaskRunnerHandle to run |reply|. - DCHECK(base::SequencedTaskRunnerHandle::IsSet()); + DCHECK(SequencedTaskRunnerHandle::IsSet()); // Owned by reply callback below. CancellationFlag* flag = new CancellationFlag(); @@ -87,12 +88,12 @@ TaskId id = next_id_; next_id_++; // int64_t is big enough that we ignore the potential overflow. - Closure untrack_closure = - Bind(&CancelableTaskTracker::Untrack, weak_factory_.GetWeakPtr(), id); + OnceClosure untrack_closure = + BindOnce(&CancelableTaskTracker::Untrack, weak_factory_.GetWeakPtr(), id); bool success = task_runner->PostTaskAndReply( from_here, BindOnce(&RunIfNotCanceled, flag, std::move(task)), - BindOnce(&RunIfNotCanceledThenUntrack, base::Owned(flag), - std::move(reply), std::move(untrack_closure))); + BindOnce(&RunIfNotCanceledThenUntrack, Owned(flag), std::move(reply), + std::move(untrack_closure))); if (!success) return kBadTaskId; @@ -104,7 +105,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId( IsCanceledCallback* is_canceled_cb) { DCHECK(sequence_checker_.CalledOnValidSequence()); - DCHECK(base::SequencedTaskRunnerHandle::IsSet()); + DCHECK(SequencedTaskRunnerHandle::IsSet()); TaskId id = next_id_; next_id_++; // int64_t is big enough that we ignore the potential overflow. @@ -112,20 +113,19 @@ // Will be deleted by |untrack_and_delete_flag| after Untrack(). CancellationFlag* flag = new CancellationFlag(); - Closure untrack_and_delete_flag = Bind( + OnceClosure untrack_and_delete_flag = BindOnce( &RunAndDeleteFlag, - Bind(&CancelableTaskTracker::Untrack, weak_factory_.GetWeakPtr(), id), + BindOnce(&CancelableTaskTracker::Untrack, weak_factory_.GetWeakPtr(), id), flag); // Will always run |untrack_and_delete_flag| on current sequence. - base::ScopedClosureRunner* untrack_and_delete_flag_runner = - new base::ScopedClosureRunner( - Bind(&RunOrPostToTaskRunner, - RetainedRef(base::SequencedTaskRunnerHandle::Get()), - untrack_and_delete_flag)); + ScopedClosureRunner* untrack_and_delete_flag_runner = + new ScopedClosureRunner(Bind( + &RunOrPostToTaskRunner, RetainedRef(SequencedTaskRunnerHandle::Get()), + Passed(&untrack_and_delete_flag))); *is_canceled_cb = - Bind(&IsCanceled, flag, base::Owned(untrack_and_delete_flag_runner)); + Bind(&IsCanceled, flag, Owned(untrack_and_delete_flag_runner)); Track(id, flag); return id;
diff --git a/base/task/cancelable_task_tracker.h b/base/task/cancelable_task_tracker.h index 4f64a24..ef5f163 100644 --- a/base/task/cancelable_task_tracker.h +++ b/base/task/cancelable_task_tracker.h
@@ -29,7 +29,8 @@ // 2. It's safe to destroy a CancelableTaskTracker while there are outstanding // tasks. This is commonly used to cancel all outstanding tasks. // -// 3. Both task and reply are deleted on the originating sequence. +// 3. The task is deleted on the target sequence, and the reply are deleted on +// the originating sequence. // // 4. IsCanceledCallback can be run or deleted on any sequence. #ifndef BASE_TASK_CANCELABLE_TASK_TRACKER_H_ @@ -63,34 +64,50 @@ typedef int64_t TaskId; static const TaskId kBadTaskId; - typedef base::Callback<bool()> IsCanceledCallback; + typedef Callback<bool()> IsCanceledCallback; CancelableTaskTracker(); // Cancels all tracked tasks. ~CancelableTaskTracker(); - TaskId PostTask(base::TaskRunner* task_runner, + TaskId PostTask(TaskRunner* task_runner, const tracked_objects::Location& from_here, - const base::Closure& task); + OnceClosure task); - TaskId PostTaskAndReply(base::TaskRunner* task_runner, + TaskId PostTaskAndReply(TaskRunner* task_runner, const tracked_objects::Location& from_here, - base::Closure task, - base::Closure reply); + OnceClosure task, + OnceClosure reply); template <typename TaskReturnType, typename ReplyArgType> - TaskId PostTaskAndReplyWithResult(base::TaskRunner* task_runner, + TaskId PostTaskAndReplyWithResult(TaskRunner* task_runner, const tracked_objects::Location& from_here, - base::Callback<TaskReturnType()> task, - base::Callback<void(ReplyArgType)> reply) { + OnceCallback<TaskReturnType()> task, + OnceCallback<void(ReplyArgType)> reply) { TaskReturnType* result = new TaskReturnType(); return PostTaskAndReply( task_runner, from_here, - base::Bind(&base::internal::ReturnAsParamAdapter<TaskReturnType>, - std::move(task), base::Unretained(result)), - base::Bind(&base::internal::ReplyAdapter<TaskReturnType, ReplyArgType>, - std::move(reply), base::Owned(result))); + BindOnce(&internal::ReturnAsParamAdapter<TaskReturnType>, + std::move(task), Unretained(result)), + BindOnce(&internal::ReplyAdapter<TaskReturnType, ReplyArgType>, + std::move(reply), Owned(result))); + } + + // Callback version of PostTaskWithTraitsAndReplyWithResult above. + // Though RepeatingCallback is convertible to OnceCallback, we need this since + // we can not use template deduction and object conversion at once on the + // overload resolution. + // TODO(tzik): Update all callers of the Callback version to use OnceCallback. + template <typename TaskReturnType, typename ReplyArgType> + TaskId PostTaskAndReplyWithResult(TaskRunner* task_runner, + const tracked_objects::Location& from_here, + Callback<TaskReturnType()> task, + Callback<void(ReplyArgType)> reply) { + return PostTaskAndReplyWithResult( + task_runner, from_here, + static_cast<OnceCallback<TaskReturnType()>>(std::move(task)), + static_cast<OnceCallback<void(ReplyArgType)>>(std::move(reply))); } // Creates a tracked TaskId and an associated IsCanceledCallback. Client can @@ -122,15 +139,15 @@ bool HasTrackedTasks() const; private: - void Track(TaskId id, base::CancellationFlag* flag); + void Track(TaskId id, CancellationFlag* flag); void Untrack(TaskId id); - base::hash_map<TaskId, base::CancellationFlag*> task_flags_; + hash_map<TaskId, CancellationFlag*> task_flags_; TaskId next_id_; SequenceChecker sequence_checker_; - base::WeakPtrFactory<CancelableTaskTracker> weak_factory_; + WeakPtrFactory<CancelableTaskTracker> weak_factory_; DISALLOW_COPY_AND_ASSIGN(CancelableTaskTracker); };
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 39a8226..f81630b4 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -1100,8 +1100,8 @@ // In order to match GPU scaling quality (which uses mip-maps at high // quality), we want to use at most medium filter quality for the // scale. - SkPixmap image_pixmap(image_info, backing_memory->data(), - image_info.minRowBytes()); + SkPixmap image_pixmap(image_info.makeColorSpace(nullptr), + backing_memory->data(), image_info.minRowBytes()); // Note that scalePixels falls back to readPixels if the sale is 1x, so // no need to special case that as an optimization. if (!draw_image.image()->scalePixels(
diff --git a/cc/tiles/gpu_image_decode_cache_unittest.cc b/cc/tiles/gpu_image_decode_cache_unittest.cc index 91a08d1f..123f84d 100644 --- a/cc/tiles/gpu_image_decode_cache_unittest.cc +++ b/cc/tiles/gpu_image_decode_cache_unittest.cc
@@ -32,6 +32,7 @@ gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); bitmap.allocPixels( SkImageInfo::MakeN32Premul(width, height, color_space.ToSkColorSpace())); + bitmap.eraseColor(0); return SkImage::MakeFromBitmap(bitmap); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java index 89fee96..065f2df 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
@@ -144,11 +144,13 @@ * @param footerResourceId The resource id for a view to add to the end of the menu list. Can * be 0 if no such view is required. * @param highlightedItemId The resource id of the menu item that should be highlighted. Can - * be 0 if no item should be highlighted. + * be {@code null} if no item should be highlighted. Note that + * {@code 0} is dedicated to custom menu items and can be declared by + * external apps. */ void show(Context context, View anchorView, boolean isByPermanentButton, int screenRotation, Rect visibleDisplayFrame, int screenHeight, @IdRes int footerResourceId, - @IdRes int highlightedItemId) { + Integer highlightedItemId) { mPopup = new ListPopupWindow(context, null, android.R.attr.popupMenuStyle); mPopup.setModal(true); mPopup.setAnchorView(anchorView);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java index 5707714a..388c035a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java
@@ -11,7 +11,6 @@ import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; -import android.support.annotation.IdRes; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.MenuItem; @@ -102,8 +101,7 @@ private final LayoutInflater mInflater; private final List<MenuItem> mMenuItems; private final int mNumMenuItems; - @IdRes - private final int mHighlightedItemId; + private final Integer mHighlightedItemId; private final float mDpToPx; // Use a single PulseDrawable to spawn the other drawables so that the ConstantState gets @@ -113,7 +111,7 @@ private PulseDrawable mHighlightDrawableSource; public AppMenuAdapter(AppMenu appMenu, List<MenuItem> menuItems, LayoutInflater inflater, - @IdRes int highlightedItemId) { + Integer highlightedItemId) { mAppMenu = appMenu; mMenuItems = menuItems; mInflater = inflater; @@ -445,6 +443,8 @@ } private void highlightItemIfNecessary(View view, boolean isIcon, int itemId) { + if (mHighlightedItemId == null) return; + Drawable background = (Drawable) view.getTag(R.id.menu_item_original_background); if (background == null) return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java index 3cb5006..27fce0f7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java
@@ -10,7 +10,6 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.IdRes; import android.view.ContextThemeWrapper; import android.view.Menu; import android.view.MenuItem; @@ -38,11 +37,11 @@ private final Activity mActivity; /** - * The resource id of the menu item to highlight when the menu next opens. A value of 0 means - * no item will be highlighted. This value will be cleared after the menu is opened. + * The resource id of the menu item to highlight when the menu next opens. A value of + * {@code null} means no item will be highlighted. This value will be cleared after the menu is + * opened. */ - @IdRes - private int mHighlightMenuId; + private Integer mHighlightMenuId; /** * Constructs an AppMenuHandler object. @@ -76,13 +75,14 @@ /** * Calls attention to this menu and a particular item in it. The menu will only stay * highlighted for one menu usage. After that the highlight will be cleared. - * @param highlightItemId The id of a menu item to highlight or {@code 0} to turn off the + * @param highlightItemId The id of a menu item to highlight or {@code null} to turn off the * highlight. */ - public void setMenuHighlight(@IdRes int highlightItemId) { - if (mHighlightMenuId == highlightItemId) return; + public void setMenuHighlight(Integer highlightItemId) { + if (mHighlightMenuId == null && highlightItemId == null) return; + if (mHighlightMenuId != null && mHighlightMenuId.equals(highlightItemId)) return; mHighlightMenuId = highlightItemId; - boolean highlighting = mHighlightMenuId != 0; + boolean highlighting = mHighlightMenuId != null; for (AppMenuObserver observer : mObservers) observer.onMenuHighlightChanged(highlighting); } @@ -165,7 +165,7 @@ mAppMenu.show(wrapper, anchorView, isByPermanentButton, rotation, appRect, pt.y, footerResourceId, mHighlightMenuId); mAppMenuDragHelper.onShow(startDragging); - setMenuHighlight(0); + setMenuHighlight(null); RecordUserAction.record("MobileMenuShow"); return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java index 6257975..cf3cc43 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java
@@ -141,6 +141,9 @@ // The maximum number of lines currently shown in the view private int mCurrentMaxLines = Integer.MAX_VALUE; + // Whether or not the full URL should always be shown. + private boolean mAlwaysShowFullUrl; + /** Constructor for inflating from XML. */ public ElidedUrlTextView(Context context, AttributeSet attrs) { super(context, attrs); @@ -202,6 +205,13 @@ } /** + * @param show Whether or not the full URL should always be shown on the page info dialog. + */ + public void setAlwaysShowFullUrl(boolean show) { + mAlwaysShowFullUrl = show; + } + + /** * Sets the profile to use when calculating the end index of the origin. * Must be called before layout. * @@ -222,7 +232,9 @@ private boolean updateMaxLines() { int maxLines = mFullLinesToDisplay; - if (mIsShowingTruncatedText) maxLines = mTruncatedUrlLinesToDisplay; + if (mIsShowingTruncatedText && !mAlwaysShowFullUrl) { + maxLines = mTruncatedUrlLinesToDisplay; + } if (maxLines != mCurrentMaxLines) { setMaxLines(maxLines); return true; @@ -262,6 +274,9 @@ // The dialog the container is placed in. private final Dialog mDialog; + // Whether or not the popup should appear at the bottom of the screen. + private final boolean mIsBottomPopup; + // Animation which is currently running, if there is one. private AnimatorSet mCurrentAnimation; @@ -306,6 +321,8 @@ String publisher) { mContext = activity; mTab = tab; + mIsBottomPopup = mTab.getActivity().getBottomSheet() != null; + if (offlinePageCreationDate != null) { mOfflinePageCreationDate = offlinePageCreationDate; } @@ -330,6 +347,7 @@ mUrlTitle = (ElidedUrlTextView) mContainer.findViewById(R.id.page_info_url); mUrlTitle.setProfile(mTab.getProfile()); + mUrlTitle.setAlwaysShowFullUrl(mIsBottomPopup); mUrlTitle.setOnClickListener(this); // Long press the url text to copy it to the clipboard. mUrlTitle.setOnLongClickListener(new OnLongClickListener() { @@ -485,6 +503,10 @@ } }); + if (mIsBottomPopup) { + mDialog.getWindow().getAttributes().gravity = Gravity.BOTTOM | Gravity.END; + } + showDialog(); } @@ -684,7 +706,22 @@ private void showDialog() { if (!DeviceFormFactor.isTablet(mContext)) { // On smaller screens, make the dialog fill the width of the screen. - ScrollView scrollView = new ScrollView(mContext); + ScrollView scrollView = new ScrollView(mContext) { + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int dialogMaxHeight = mTab.getHeight(); + if (mIsBottomPopup) { + // In Chrome Home, the full URL is showing at all times; give the scroll + // view a max height so long URLs don't consume the entire screen. + dialogMaxHeight -= + mContext.getResources().getDimension(R.dimen.min_touch_target_size); + } + + heightMeasureSpec = + MeasureSpec.makeMeasureSpec(dialogMaxHeight, MeasureSpec.AT_MOST); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + }; scrollView.addView(mContainer); mDialog.addContentView(scrollView, new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, @@ -869,7 +906,7 @@ * Create an animator to slide in the entire dialog from the top of the screen. */ private Animator createDialogSlideAnimator(boolean isEnter) { - final float animHeight = -1f * mContainer.getHeight(); + final float animHeight = (mIsBottomPopup ? 1f : -1f) * mContainer.getHeight(); ObjectAnimator translateAnim; if (isEnter) { mContainer.setTranslationY(animHeight);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java index 74ee260a..8ba065f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -46,6 +46,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.components.payments.CurrencyFormatter; +import org.chromium.components.payments.OriginSecurityChecker; import org.chromium.components.payments.PaymentValidator; import org.chromium.components.url_formatter.UrlFormatter; import org.chromium.content_public.browser.RenderFrameHost; @@ -406,6 +407,31 @@ if (mClient != null || client == null) return; mClient = client; + if (!OriginSecurityChecker.isOriginSecure(mWebContents.getLastCommittedUrl())) { + recordAbortReasonHistogram( + PaymentRequestMetrics.ABORT_REASON_INVALID_DATA_FROM_RENDERER); + disconnectFromClientWithDebugMessage("Not in a secure context"); + return; + } + + mRequestShipping = options != null && options.requestShipping; + mRequestPayerName = options != null && options.requestPayerName; + mRequestPayerPhone = options != null && options.requestPayerPhone; + mRequestPayerEmail = options != null && options.requestPayerEmail; + mShippingType = options == null ? PaymentShippingType.SHIPPING : options.shippingType; + + PaymentRequestMetrics.recordRequestedInformationHistogram( + mRequestPayerEmail, mRequestPayerPhone, mRequestShipping, mRequestPayerName); + + if (OriginSecurityChecker.isSchemeCryptographic(mWebContents.getLastCommittedUrl()) + && !SslValidityChecker.isSslCertificateValid(mWebContents)) { + Log.d(TAG, "SSL certificate is not valid"); + // Don't show any UI. Resolve .canMakePayment() with "false". Reject .show() with + // "NotSupportedError". + onAllPaymentAppsCreated(); + return; + } + if (mMethodData != null) { disconnectFromClientWithDebugMessage("PaymentRequest.show() called more than once."); recordAbortReasonHistogram( @@ -433,12 +459,6 @@ PaymentAppFactory.getInstance().create(mWebContents, Collections.unmodifiableSet(mMethodData.keySet()), this /* callback */); - mRequestShipping = options != null && options.requestShipping; - mRequestPayerName = options != null && options.requestPayerName; - mRequestPayerPhone = options != null && options.requestPayerPhone; - mRequestPayerEmail = options != null && options.requestPayerEmail; - mShippingType = options == null ? PaymentShippingType.SHIPPING : options.shippingType; - // If there is a single payment method and the merchant has not requested any other // information, we can safely go directly to the payment app instead of showing // Payment Request UI. @@ -451,9 +471,6 @@ // the payment request UI, thus can't be skipped. && mMethodData.keySet().iterator().next() != null && mMethodData.keySet().iterator().next().startsWith(UrlConstants.HTTPS_URL_PREFIX); - - PaymentRequestMetrics.recordRequestedInformationHistogram(mRequestPayerEmail, - mRequestPayerPhone, mRequestShipping, mRequestPayerName); } private void buildUI(Activity activity) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java new file mode 100644 index 0000000..6db66716 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java
@@ -0,0 +1,26 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments; + +import org.chromium.base.annotations.JNINamespace; +import org.chromium.content_public.browser.WebContents; + +/** SSL validity checker. */ +@JNINamespace("payments") +public class SslValidityChecker { + /** + * Returns true for web contents with a valid SSL certificate. + * + * @param webContents The web contents to check. + * @return Whether the web contents have a valid SSL certificate. + */ + public static boolean isSslCertificateValid(WebContents webContents) { + return nativeIsSslCertificateValid(webContents); + } + + private SslValidityChecker() {} + + private static native boolean nativeIsSslCertificateValid(WebContents webContents); +} \ No newline at end of file
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index b74c28b..2c1ccb7 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -742,6 +742,7 @@ "java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java", "java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentInstrument.java", "java/src/org/chromium/chrome/browser/payments/ShippingStrings.java", + "java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java", "java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java", "java/src/org/chromium/chrome/browser/payments/ui/Completable.java", "java/src/org/chromium/chrome/browser/payments/ui/ContactDetailsSection.java",
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index eabe276..12af2df7 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -1929,13 +1929,32 @@ desc="Text for the search button in the touch bar when Google is not the default search provider. Pressing the button will bring focus to the omnibox. $1 is the name of the search provider)"> Search <ph name="SEARCH_ENGINE">$1<ex>Bing</ex></ph> </message> - <message name="IDS_TOOLTIP_TOUCH_BAR_BACK" desc="The tooltip for the touch bar back button."> Touch to go back. </message> <message name="IDS_TOOLTIP_TOUCH_BAR_FORWARD" desc="The tooltip for the touch bar forward button."> Touch to go forward. </message> + <message name="IDS_TOUCH_BAR_BACK_FORWARD_CUSTOMIZATION_LABEL" + desc="Customization label for the back and forward buttons in the touch bar."> + Back/Forward + </message> + <message name="IDS_TOUCH_BAR_STOP_RELOAD_CUSTOMIZATION_LABEL" + desc="Customization label for the stop or reload button in the touch bar."> + Stop/Reload + </message> + <message name="IDS_TOUCH_BAR_HOME_CUSTOMIZATION_LABEL" + desc="Customization label for the home button in the touch bar."> + Home + </message> + <message name="IDS_TOUCH_BAR_BOOKMARK_CUSTOMIZATION_LABEL" + desc="Customization label for the bookmark button in the touch bar."> + Bookmark + </message> + <message name="IDS_TOUCH_BAR_NEW_TAB_CUSTOMIZATION_LABEL" + desc="Customization label for the new tab button in the touch bar."> + New Tab + </message> </if> <!-- Remove in-progress downloads confirmation dialog -->
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index fbf1c51..39e83d9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -868,6 +868,8 @@ "password_manager/password_store_win.h", "password_manager/simple_password_store_mac.cc", "password_manager/simple_password_store_mac.h", + "payments/ssl_validity_checker.cc", + "payments/ssl_validity_checker.h", "performance_monitor/performance_monitor.cc", "performance_monitor/performance_monitor.h", "performance_monitor/process_metrics_history.cc", @@ -2603,10 +2605,6 @@ "signin/signin_global_error.h", "signin/signin_global_error_factory.cc", "signin/signin_global_error_factory.h", - "sync/sync_global_error.cc", - "sync/sync_global_error.h", - "sync/sync_global_error_factory.cc", - "sync/sync_global_error_factory.h", "upgrade_detector_impl.cc", "upgrade_detector_impl.h", ] @@ -3107,6 +3105,8 @@ "payments/android/chrome_payments_jni_registrar.h", "payments/android/journey_logger_android.cc", "payments/android/journey_logger_android.h", + "payments/android/ssl_validity_checker_android.cc", + "payments/android/ssl_validity_checker_android.h", "permissions/grouped_permission_infobar_delegate_android.cc", "permissions/grouped_permission_infobar_delegate_android.h", "permissions/permission_dialog_delegate.cc", @@ -4190,6 +4190,7 @@ "../android/java/src/org/chromium/chrome/browser/password_manager/Credential.java", "../android/java/src/org/chromium/chrome/browser/payments/JourneyLogger.java", "../android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java", + "../android/java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java", "../android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java", "../android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogDelegate.java", "../android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBroadcastService.java",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4c3b8b2..834e0e99 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2521,7 +2521,9 @@ FEATURE_WITH_PARAMS_VALUE_TYPE( autofill::kAutofillCreditCardPopupLayout, kAutofillCreditCardPopupLayoutFeatureVariations, - "AutofillCreditCardPopupLayout")}, + // Must be AutofillCreditCardDropdownVariations to prevent DCHECK crash + // when the flag is manually enabled in a local build. + "AutofillCreditCardDropdownVariations")}, {"native-android-history-manager", flag_descriptions::kNativeAndroidHistoryManager, flag_descriptions::kNativeAndroidHistoryManagerDescription, kOsAndroid, @@ -2534,7 +2536,9 @@ FEATURE_WITH_PARAMS_VALUE_TYPE( autofill::kAutofillCreditCardLastUsedDateDisplay, kAutofillCreditCardLastUsedDateFeatureVariations, - "AutofillCreditCardLastUsedDate")}, + // Must be AutofillCreditCardDropdownVariations to prevent DCHECK crash + // when the flag is manually enabled in a local build. + "AutofillCreditCardDropdownVariations")}, {"enable-autofill-credit-card-upload-cvc-prompt", flag_descriptions::kEnableAutofillCreditCardUploadCvcPrompt, flag_descriptions::kEnableAutofillCreditCardUploadCvcPromptDescription,
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 78d27e24..f6e6ec57 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm
@@ -741,6 +741,12 @@ handoff_active_url_observer_bridge_.reset( new HandoffActiveURLObserverBridge(self)); + + NSApplication* application = [NSApplication sharedApplication]; + if ([application respondsToSelector: + @selector(setAutomaticCustomizeTouchBarMenuItemEnabled:)]) { + [application setAutomaticCustomizeTouchBarMenuItemEnabled:YES]; + } } // Helper function for populating and displaying the in progress downloads at
diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc index 7f5d8c3..0673559 100644 --- a/chrome/browser/chromeos/status/network_menu.cc +++ b/chrome/browser/chromeos/status/network_menu.cc
@@ -511,7 +511,7 @@ if (scanning_msg) AddMessageItem(l10n_util::GetStringUTF16(scanning_msg)); const gfx::ImageSkia icon = - ash::network_icon::GetBasicImageForWiFiNetwork(true); + ash::network_icon::GetImageForWiFiEnabledState(true); menu_items_.push_back(MenuItem( ui::MenuModel::TYPE_COMMAND, l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_WIFI_NETWORKS),
diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn index 88bf81a..4c049d9 100644 --- a/chrome/browser/devtools/BUILD.gn +++ b/chrome/browser/devtools/BUILD.gn
@@ -112,6 +112,8 @@ "devtools_contents_resizing_strategy.h", "devtools_embedder_message_dispatcher.cc", "devtools_embedder_message_dispatcher.h", + "devtools_eye_dropper.cc", + "devtools_eye_dropper.h", "devtools_file_helper.cc", "devtools_file_helper.h", "devtools_file_system_indexer.cc",
diff --git a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc index 80cb32e3..cb88e62 100644 --- a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc +++ b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
@@ -183,6 +183,8 @@ d->RegisterHandler("searchInPath", &Delegate::SearchInPath, delegate); d->RegisterHandler("setWhitelistedShortcuts", &Delegate::SetWhitelistedShortcuts, delegate); + d->RegisterHandler("setEyeDropperActive", &Delegate::SetEyeDropperActive, + delegate); d->RegisterHandler("showCertificateViewer", &Delegate::ShowCertificateViewer, delegate); d->RegisterHandler("zoomIn", &Delegate::ZoomIn, delegate);
diff --git a/chrome/browser/devtools/devtools_embedder_message_dispatcher.h b/chrome/browser/devtools/devtools_embedder_message_dispatcher.h index 77f4f77..681012c 100644 --- a/chrome/browser/devtools/devtools_embedder_message_dispatcher.h +++ b/chrome/browser/devtools/devtools_embedder_message_dispatcher.h
@@ -62,6 +62,7 @@ const std::string& file_system_path, const std::string& query) = 0; virtual void SetWhitelistedShortcuts(const std::string& message) = 0; + virtual void SetEyeDropperActive(bool active) = 0; virtual void ShowCertificateViewer(const std::string& cert_chain) = 0; virtual void ZoomIn() = 0; virtual void ZoomOut() = 0;
diff --git a/chrome/browser/devtools/devtools_eye_dropper.cc b/chrome/browser/devtools/devtools_eye_dropper.cc new file mode 100644 index 0000000..ca08c13 --- /dev/null +++ b/chrome/browser/devtools/devtools_eye_dropper.cc
@@ -0,0 +1,250 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/devtools/devtools_eye_dropper.h" + +#include "base/bind.h" +#include "build/build_config.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/browser/render_widget_host.h" +#include "content/public/browser/render_widget_host_view.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/cursor_info.h" +#include "content/public/common/screen_info.h" +#include "third_party/WebKit/public/platform/WebInputEvent.h" +#include "third_party/WebKit/public/platform/WebMouseEvent.h" +#include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkPaint.h" +#include "third_party/skia/include/core/SkPath.h" +#include "ui/gfx/geometry/size_conversions.h" + +DevToolsEyeDropper::DevToolsEyeDropper(content::WebContents* web_contents, + EyeDropperCallback callback) + : content::WebContentsObserver(web_contents), + callback_(callback), + last_cursor_x_(-1), + last_cursor_y_(-1), + host_(nullptr), + weak_factory_(this) { + mouse_event_callback_ = + base::Bind(&DevToolsEyeDropper::HandleMouseEvent, base::Unretained(this)); + content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); + if (rvh) { + AttachToHost(rvh->GetWidget()); + UpdateFrame(); + } +} + +DevToolsEyeDropper::~DevToolsEyeDropper() { + DetachFromHost(); +} + +void DevToolsEyeDropper::AttachToHost(content::RenderWidgetHost* host) { + host_ = host; + host_->AddMouseEventCallback(mouse_event_callback_); +} + +void DevToolsEyeDropper::DetachFromHost() { + if (!host_) + return; + host_->RemoveMouseEventCallback(mouse_event_callback_); + content::CursorInfo cursor_info; + cursor_info.type = blink::WebCursorInfo::kTypePointer; + host_->SetCursor(cursor_info); + host_ = nullptr; +} + +void DevToolsEyeDropper::RenderViewCreated(content::RenderViewHost* host) { + if (!host_) { + AttachToHost(host->GetWidget()); + UpdateFrame(); + } +} + +void DevToolsEyeDropper::RenderViewDeleted(content::RenderViewHost* host) { + if (host->GetWidget() == host_) { + DetachFromHost(); + ResetFrame(); + } +} + +void DevToolsEyeDropper::RenderViewHostChanged( + content::RenderViewHost* old_host, + content::RenderViewHost* new_host) { + if ((old_host && old_host->GetWidget() == host_) || (!old_host && !host_)) { + DetachFromHost(); + AttachToHost(new_host->GetWidget()); + UpdateFrame(); + } +} + +void DevToolsEyeDropper::DidReceiveCompositorFrame() { + UpdateFrame(); +} + +void DevToolsEyeDropper::UpdateFrame() { + if (!host_ || !host_->GetView()) + return; + + // TODO(miu): This is the wrong size. It's the size of the view on-screen, and + // not the rendering size of the view. The latter is what is wanted here, so + // that the resulting bitmap's pixel coordinates line-up with the + // blink::WebMouseEvent coordinates. http://crbug.com/73362 + gfx::Size should_be_rendering_size = host_->GetView()->GetViewBounds().size(); + host_->GetView()->CopyFromSurface( + gfx::Rect(), should_be_rendering_size, + base::Bind(&DevToolsEyeDropper::FrameUpdated, weak_factory_.GetWeakPtr()), + kN32_SkColorType); +} + +void DevToolsEyeDropper::ResetFrame() { + frame_.reset(); + last_cursor_x_ = -1; + last_cursor_y_ = -1; +} + +void DevToolsEyeDropper::FrameUpdated(const SkBitmap& bitmap, + content::ReadbackResponse response) { + if (response == content::READBACK_SUCCESS) { + frame_ = bitmap; + UpdateCursor(); + } +} + +bool DevToolsEyeDropper::HandleMouseEvent(const blink::WebMouseEvent& event) { + last_cursor_x_ = event.PositionInWidget().x; + last_cursor_y_ = event.PositionInWidget().y; + if (frame_.drawsNothing()) + return true; + + if (event.button == blink::WebMouseEvent::Button::kLeft && + (event.GetType() == blink::WebInputEvent::kMouseDown || + event.GetType() == blink::WebInputEvent::kMouseMove)) { + if (last_cursor_x_ < 0 || last_cursor_x_ >= frame_.width() || + last_cursor_y_ < 0 || last_cursor_y_ >= frame_.height()) { + return true; + } + + SkAutoLockPixels lock_image(frame_); + SkColor sk_color = frame_.getColor(last_cursor_x_, last_cursor_y_); + callback_.Run(SkColorGetR(sk_color), SkColorGetG(sk_color), + SkColorGetB(sk_color), SkColorGetA(sk_color)); + } + UpdateCursor(); + return true; +} + +void DevToolsEyeDropper::UpdateCursor() { + if (!host_ || frame_.drawsNothing()) + return; + + if (last_cursor_x_ < 0 || last_cursor_x_ >= frame_.width() || + last_cursor_y_ < 0 || last_cursor_y_ >= frame_.height()) { + return; + } + +// Due to platform limitations, we are using two different cursors +// depending on the platform. Mac and Win have large cursors with two circles +// for original spot and its magnified projection; Linux gets smaller (64 px) +// magnified projection only with centered hotspot. +// Mac Retina requires cursor to be > 120px in order to render smoothly. + +#if defined(OS_LINUX) + const float kCursorSize = 63; + const float kDiameter = 63; + const float kHotspotOffset = 32; + const float kHotspotRadius = 0; + const float kPixelSize = 9; +#else + const float kCursorSize = 150; + const float kDiameter = 110; + const float kHotspotOffset = 25; + const float kHotspotRadius = 5; + const float kPixelSize = 10; +#endif + + content::ScreenInfo screen_info; + host_->GetScreenInfo(&screen_info); + double device_scale_factor = screen_info.device_scale_factor; + + SkBitmap result; + result.allocN32Pixels(kCursorSize * device_scale_factor, + kCursorSize * device_scale_factor); + result.eraseARGB(0, 0, 0, 0); + + SkCanvas canvas(result); + canvas.scale(device_scale_factor, device_scale_factor); + canvas.translate(0.5f, 0.5f); + + SkPaint paint; + + // Paint original spot with cross. + if (kHotspotRadius > 0) { + paint.setStrokeWidth(1); + paint.setAntiAlias(false); + paint.setColor(SK_ColorDKGRAY); + paint.setStyle(SkPaint::kStroke_Style); + + canvas.drawLine(kHotspotOffset, kHotspotOffset - 2 * kHotspotRadius, + kHotspotOffset, kHotspotOffset - kHotspotRadius, paint); + canvas.drawLine(kHotspotOffset, kHotspotOffset + kHotspotRadius, + kHotspotOffset, kHotspotOffset + 2 * kHotspotRadius, paint); + canvas.drawLine(kHotspotOffset - 2 * kHotspotRadius, kHotspotOffset, + kHotspotOffset - kHotspotRadius, kHotspotOffset, paint); + canvas.drawLine(kHotspotOffset + kHotspotRadius, kHotspotOffset, + kHotspotOffset + 2 * kHotspotRadius, kHotspotOffset, paint); + + paint.setStrokeWidth(2); + paint.setAntiAlias(true); + canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint); + } + + // Clip circle for magnified projection. + float padding = (kCursorSize - kDiameter) / 2; + SkPath clip_path; + clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter)); + clip_path.close(); + canvas.clipPath(clip_path, SkClipOp::kIntersect, true); + + // Project pixels. + int pixel_count = kDiameter / kPixelSize; + SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2, + last_cursor_y_ - pixel_count / 2, + pixel_count, pixel_count); + SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter); + canvas.drawBitmapRect(frame_, src_rect, dst_rect, NULL); + + // Paint grid. + paint.setStrokeWidth(1); + paint.setAntiAlias(false); + paint.setColor(SK_ColorGRAY); + for (int i = 0; i < pixel_count; ++i) { + canvas.drawLine(padding + i * kPixelSize, padding, padding + i * kPixelSize, + kCursorSize - padding, paint); + canvas.drawLine(padding, padding + i * kPixelSize, kCursorSize - padding, + padding + i * kPixelSize, paint); + } + + // Paint central pixel in red. + SkRect pixel = + SkRect::MakeXYWH((kCursorSize - kPixelSize) / 2, + (kCursorSize - kPixelSize) / 2, kPixelSize, kPixelSize); + paint.setColor(SK_ColorRED); + paint.setStyle(SkPaint::kStroke_Style); + canvas.drawRect(pixel, paint); + + // Paint outline. + paint.setStrokeWidth(2); + paint.setColor(SK_ColorDKGRAY); + paint.setAntiAlias(true); + canvas.drawCircle(kCursorSize / 2, kCursorSize / 2, kDiameter / 2, paint); + + content::CursorInfo cursor_info; + cursor_info.type = blink::WebCursorInfo::kTypeCustom; + cursor_info.image_scale_factor = device_scale_factor; + cursor_info.custom_image = result; + cursor_info.hotspot = gfx::Point(kHotspotOffset * device_scale_factor, + kHotspotOffset * device_scale_factor); + host_->SetCursor(cursor_info); +}
diff --git a/chrome/browser/devtools/devtools_eye_dropper.h b/chrome/browser/devtools/devtools_eye_dropper.h new file mode 100644 index 0000000..8d92d53c --- /dev/null +++ b/chrome/browser/devtools/devtools_eye_dropper.h
@@ -0,0 +1,55 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EYE_DROPPER_H_ +#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EYE_DROPPER_H_ + +#include "base/callback.h" +#include "base/macros.h" +#include "content/public/browser/readback_types.h" +#include "content/public/browser/render_widget_host.h" +#include "content/public/browser/web_contents_observer.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace blink { +class WebMouseEvent; +} + +class DevToolsEyeDropper : public content::WebContentsObserver { + public: + typedef base::Callback<void(int, int, int, int)> EyeDropperCallback; + + DevToolsEyeDropper(content::WebContents* web_contents, + EyeDropperCallback callback); + ~DevToolsEyeDropper() override; + + private: + void AttachToHost(content::RenderWidgetHost* host); + void DetachFromHost(); + + // content::WebContentsObserver. + void DidReceiveCompositorFrame() override; + void RenderViewCreated(content::RenderViewHost* host) override; + void RenderViewDeleted(content::RenderViewHost* host) override; + void RenderViewHostChanged(content::RenderViewHost* old_host, + content::RenderViewHost* new_host) override; + + void UpdateFrame(); + void ResetFrame(); + void FrameUpdated(const SkBitmap&, content::ReadbackResponse); + bool HandleMouseEvent(const blink::WebMouseEvent& event); + void UpdateCursor(); + + EyeDropperCallback callback_; + SkBitmap frame_; + int last_cursor_x_; + int last_cursor_y_; + content::RenderWidgetHost::MouseEventCallback mouse_event_callback_; + content::RenderWidgetHost* host_; + base::WeakPtrFactory<DevToolsEyeDropper> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(DevToolsEyeDropper); +}; + +#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EYE_DROPPER_H_
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 3863863..5b478e5 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -209,6 +209,7 @@ void SetIsDocked(bool is_docked) override {} void OpenInNewTab(const std::string& url) override; void SetWhitelistedShortcuts(const std::string& message) override {} + void SetEyeDropperActive(bool active) override {} void OpenNodeFrontend() override {} using DispatchCallback = DevToolsEmbedderMessageDispatcher::Delegate::DispatchCallback; @@ -852,6 +853,10 @@ delegate_->SetWhitelistedShortcuts(message); } +void DevToolsUIBindings::SetEyeDropperActive(bool active) { + delegate_->SetEyeDropperActive(active); +} + void DevToolsUIBindings::ShowCertificateViewer(const std::string& cert_chain) { std::unique_ptr<base::Value> value = base::JSONReader::Read(cert_chain);
diff --git a/chrome/browser/devtools/devtools_ui_bindings.h b/chrome/browser/devtools/devtools_ui_bindings.h index 64e051d..a278572 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.h +++ b/chrome/browser/devtools/devtools_ui_bindings.h
@@ -57,6 +57,7 @@ virtual void SetIsDocked(bool is_docked) = 0; virtual void OpenInNewTab(const std::string& url) = 0; virtual void SetWhitelistedShortcuts(const std::string& message) = 0; + virtual void SetEyeDropperActive(bool active) = 0; virtual void OpenNodeFrontend() = 0; virtual void InspectedContentsClosing() = 0; @@ -123,6 +124,7 @@ const std::string& file_system_path, const std::string& query) override; void SetWhitelistedShortcuts(const std::string& message) override; + void SetEyeDropperActive(bool active) override; void ShowCertificateViewer(const std::string& cert_chain) override; void ZoomIn() override; void ZoomOut() override;
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 14aefab9..94d7954 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -17,6 +17,7 @@ #include "base/values.h" #include "chrome/browser/certificate_viewer.h" #include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h" +#include "chrome/browser/devtools/devtools_eye_dropper.h" #include "chrome/browser/file_select_helper.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" @@ -1245,6 +1246,29 @@ event_forwarder_->SetWhitelistedShortcuts(message); } +void DevToolsWindow::SetEyeDropperActive(bool active) { + WebContents* web_contents = GetInspectedWebContents(); + if (!web_contents) + return; + if (active) { + eye_dropper_.reset(new DevToolsEyeDropper( + web_contents, base::Bind(&DevToolsWindow::ColorPickedInEyeDropper, + base::Unretained(this)))); + } else { + eye_dropper_.reset(); + } +} + +void DevToolsWindow::ColorPickedInEyeDropper(int r, int g, int b, int a) { + base::DictionaryValue color; + color.SetInteger("r", r); + color.SetInteger("g", g); + color.SetInteger("b", b); + color.SetInteger("a", a); + bindings_->CallClientFunction("DevToolsAPI.eyeDropperPickedColor", &color, + nullptr, nullptr); +} + void DevToolsWindow::InspectedContentsClosing() { if (!close_on_detach_) return;
diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h index ee78847..9e8ca3e0 100644 --- a/chrome/browser/devtools/devtools_window.h +++ b/chrome/browser/devtools/devtools_window.h
@@ -16,6 +16,7 @@ class BrowserWindow; class DevToolsWindowTesting; class DevToolsEventForwarder; +class DevToolsEyeDropper; namespace content { class DevToolsAgentHost; @@ -326,6 +327,7 @@ void SetIsDocked(bool is_docked) override; void OpenInNewTab(const std::string& url) override; void SetWhitelistedShortcuts(const std::string& message) override; + void SetEyeDropperActive(bool active) override; void OpenNodeFrontend() override; void InspectedContentsClosing() override; void OnLoadCompleted() override; @@ -333,6 +335,7 @@ InfoBarService* GetInfoBarService() override; void RenderProcessGone(bool crashed) override; + void ColorPickedInEyeDropper(int r, int g, int b, int a); void CreateDevToolsBrowser(); BrowserWindow* GetInspectedBrowserWindow(); void ScheduleShow(const DevToolsToggleAction& action); @@ -365,6 +368,7 @@ base::TimeTicks inspect_element_start_time_; std::unique_ptr<DevToolsEventForwarder> event_forwarder_; + std::unique_ptr<DevToolsEyeDropper> eye_dropper_; friend class DevToolsEventForwarder; DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
diff --git a/chrome/browser/payments/android/chrome_payments_jni_registrar.cc b/chrome/browser/payments/android/chrome_payments_jni_registrar.cc index bd40582..f04a124 100644 --- a/chrome/browser/payments/android/chrome_payments_jni_registrar.cc +++ b/chrome/browser/payments/android/chrome_payments_jni_registrar.cc
@@ -8,12 +8,14 @@ #include "base/android/jni_registrar.h" #include "base/macros.h" #include "chrome/browser/payments/android/journey_logger_android.h" +#include "chrome/browser/payments/android/ssl_validity_checker_android.h" namespace payments { namespace android { static base::android::RegistrationMethod kChromePaymentsRegisteredMethods[] = { {"JourneyLogger", JourneyLoggerAndroid::Register}, + {"SslValidityChecker", RegisterSslValidityChecker}, }; bool RegisterChromePayments(JNIEnv* env) {
diff --git a/chrome/browser/payments/android/ssl_validity_checker_android.cc b/chrome/browser/payments/android/ssl_validity_checker_android.cc new file mode 100644 index 0000000..1d7658d --- /dev/null +++ b/chrome/browser/payments/android/ssl_validity_checker_android.cc
@@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/payments/android/ssl_validity_checker_android.h" + +#include "base/android/scoped_java_ref.h" +#include "chrome/browser/payments/ssl_validity_checker.h" +#include "content/public/browser/web_contents.h" +#include "jni/SslValidityChecker_jni.h" + +namespace payments { + +// static +jboolean IsSslCertificateValid( + JNIEnv* env, + const base::android::JavaParamRef<jclass>& jcaller, + const base::android::JavaParamRef<jobject>& jweb_contents) { + return SslValidityChecker::IsSslCertificateValid( + content::WebContents::FromJavaWebContents(jweb_contents)); +} + +bool RegisterSslValidityChecker(JNIEnv* env) { + return RegisterNativesImpl(env); +} + +} // namespace payments
diff --git a/chrome/browser/payments/android/ssl_validity_checker_android.h b/chrome/browser/payments/android/ssl_validity_checker_android.h new file mode 100644 index 0000000..c6d1bb85c --- /dev/null +++ b/chrome/browser/payments/android/ssl_validity_checker_android.h
@@ -0,0 +1,16 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_PAYMENTS_ANDROID_SSL_VALIDITY_CHECKER_ANDROID_H_ +#define CHROME_BROWSER_PAYMENTS_ANDROID_SSL_VALIDITY_CHECKER_ANDROID_H_ + +#include <jni.h> + +namespace payments { + +bool RegisterSslValidityChecker(JNIEnv* env); + +} // namespace payments + +#endif // CHROME_BROWSER_PAYMENTS_ANDROID_SSL_VALIDITY_CHECKER_ANDROID_H_
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc index bd23df5..44126e7 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.cc +++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -7,6 +7,7 @@ #include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/autofill/validation_rules_storage_factory.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/payments/ssl_validity_checker.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_dialogs.h" #include "components/autofill/core/browser/personal_data_manager.h" @@ -55,6 +56,14 @@ return profile && profile->GetProfileType() == Profile::INCOGNITO_PROFILE; } +bool ChromePaymentRequestDelegate::IsSslCertificateValid() { + return SslValidityChecker::IsSslCertificateValid(web_contents_); +} + +const GURL& ChromePaymentRequestDelegate::GetLastCommittedURL() const { + return web_contents_->GetLastCommittedURL(); +} + void ChromePaymentRequestDelegate::DoFullCardRequest( const autofill::CreditCard& credit_card, base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.h b/chrome/browser/payments/chrome_payment_request_delegate.h index 499958c..69a9a2b 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.h +++ b/chrome/browser/payments/chrome_payment_request_delegate.h
@@ -31,6 +31,8 @@ autofill::PersonalDataManager* GetPersonalDataManager() override; const std::string& GetApplicationLocale() const override; bool IsIncognito() const override; + bool IsSslCertificateValid() override; + const GURL& GetLastCommittedURL() const override; void DoFullCardRequest( const autofill::CreditCard& credit_card, base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>
diff --git a/chrome/browser/payments/ssl_validity_checker.cc b/chrome/browser/payments/ssl_validity_checker.cc new file mode 100644 index 0000000..0edd4e8 --- /dev/null +++ b/chrome/browser/payments/ssl_validity_checker.cc
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/payments/ssl_validity_checker.h" + +#include "base/logging.h" +#include "chrome/browser/ssl/security_state_tab_helper.h" +#include "components/security_state/core/security_state.h" + +namespace payments { + +// static +bool SslValidityChecker::IsSslCertificateValid( + content::WebContents* web_contents) { + DCHECK(web_contents); + SecurityStateTabHelper::CreateForWebContents(web_contents); + SecurityStateTabHelper* helper = + SecurityStateTabHelper::FromWebContents(web_contents); + DCHECK(helper); + security_state::SecurityInfo security_info; + helper->GetSecurityInfo(&security_info); + return security_info.security_level == security_state::EV_SECURE || + security_info.security_level == security_state::SECURE || + security_info.security_level == + security_state::SECURE_WITH_POLICY_INSTALLED_CERT; +} + +} // namespace payments
diff --git a/chrome/browser/payments/ssl_validity_checker.h b/chrome/browser/payments/ssl_validity_checker.h new file mode 100644 index 0000000..640dcfa --- /dev/null +++ b/chrome/browser/payments/ssl_validity_checker.h
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_PAYMENTS_SSL_VALIDITY_CHECKER_H_ +#define CHROME_BROWSER_PAYMENTS_SSL_VALIDITY_CHECKER_H_ + +#include "base/macros.h" + +namespace content { +class WebContents; +} + +namespace payments { + +class SslValidityChecker { + public: + // Returns true for |web_contents| with a valid SSL certificate. Only + // EV_SECURE, SECURE, and SECURE_WITH_POLICY_INSTALLED_CERT are considered + // valid for web payments. + static bool IsSslCertificateValid(content::WebContents* web_contents); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(SslValidityChecker); +}; + +} // namespace payments + +#endif // CHROME_BROWSER_PAYMENTS_SSL_VALIDITY_CHECKER_H_
diff --git a/chrome/browser/resources/chromeos/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/chromevox/BUILD.gn index 0cb2c8a0..913079e 100644 --- a/chrome/browser/resources/chromeos/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/chromevox/BUILD.gn
@@ -24,6 +24,7 @@ chromevox_modules = [ "braille/braille_display_manager.js", "braille/braille_input_handler.js", + "braille/braille_key_event_rewriter.js", "braille/braille_key_types.js", "braille/braille_table.js", "braille/braille_translator_manager.js",
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_key_event_rewriter.js b/chrome/browser/resources/chromeos/chromevox/braille/braille_key_event_rewriter.js new file mode 100644 index 0000000..30f148cf --- /dev/null +++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_key_event_rewriter.js
@@ -0,0 +1,82 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Rewrites a braille key event. + */ + +goog.provide('BrailleKeyEventRewriter'); + +goog.require('Output'); +goog.require('cvox.BrailleKeyEvent'); + +/** + * A class that transforms a sequence of braille key events into a standard key + * event. + * @constructor + */ +BrailleKeyEventRewriter = function() { + /** @private {Object} */ + this.incrementalKey_ = null; +}; + +BrailleKeyEventRewriter.prototype = { + /** + * Accumulates and optionally modifies in-coming braille key events. + * @param {cvox.BrailleKeyEvent} evt + * @return {boolean} False to continue event propagation. + */ + onBrailleKeyEvent: function(evt) { + var standardKeyCode; + var dots = evt.brailleDots; + if (!dots) { + this.incrementalKey_ = null; + return false; + } + + if (evt.command == cvox.BrailleKeyCommand.CHORD) { + Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH); + var modifiers = cvox.BrailleKeyEvent.brailleDotsToModifiers[dots]; + + // Check for a modifier mapping. + if (modifiers) { + this.incrementalKey_ = this.incrementalKey_ || {}; + for (var key in modifiers) { + this.incrementalKey_[key] = true; + } + + return true; + } + + // Check for a chord to standard key mapping. + standardKeyCode = + cvox.BrailleKeyEvent.brailleChordsToStandardKeyCode[dots]; + } + + // Check for a 'dots' command, which is typed on the keyboard with a + // previous incremental key press. + if (evt.command == cvox.BrailleKeyCommand.DOTS && this.incrementalKey_) { + // Check if this braille pattern has a standard key mapping. + standardKeyCode = + cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode[dots]; + } + + if (standardKeyCode) { + evt.command = cvox.BrailleKeyCommand.STANDARD_KEY; + evt.standardKeyCode = standardKeyCode; + if (this.incrementalKey_) { + // Apply all modifiers seen so far to the outgoing event as a standard + // keyboard command. + evt.altKey = this.incrementalKey_.altKey; + evt.ctrlKey = this.incrementalKey_.ctrlKey; + evt.shiftKey = this.incrementalKey_.shiftKey; + this.incrementalKey_ = null; + } + return false; + } + + this.incrementalKey_ = null; + return false; + } +};
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_key_types.js b/chrome/browser/resources/chromeos/chromevox/braille/braille_key_types.js index 9d411ff..1f5a044 100644 --- a/chrome/browser/resources/chromeos/chromevox/braille/braille_key_types.js +++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_key_types.js
@@ -94,6 +94,88 @@ return SPECIAL_CODES[keyCode] || keyCode.charCodeAt(0); }; +/* + * Note: Some of the below mappings contain raw braille dot + * patterns. These are written out in binary form to make clear + * exactly what dots in the braille cell make up the pattern. The + * braille cell is arranged in a 2 by 4 dot grid with each dot + * assigned a number from 1-8. + * 1 4 + * 2 5 + * 3 6 + * 7 8 + * + * In binary form, the dot number minus 1 maps to the bit position + * (from right to left). + * For example, dots 1-6-7 would be + * 0b1100001 + */ + +/** + * Maps a braille pattern to a standard key code. + * @type {!Object<number, string>} + */ +cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode = { + 0b1: 'A', + 0b11: 'B', + 0b1001: 'C', + 0b11001: 'D', + 0b10001: 'E', + 0b1011: 'F', + 0b11011: 'G', + 0b10011: 'H', + 0b1010: 'I', + 0b11010: 'J', + 0b101: 'K', + 0b111: 'L', + 0b1101: 'M', + 0b11101: 'N', + 0b10101: 'O', + 0b1111: 'P', + 0b11111: 'Q', + 0b10111: 'R', + 0b1110: 'S', + 0b11110: 'T', + 0b100101: 'U', + 0b100111: 'V', + 0b111010: 'W', + 0b101101: 'X', + 0b111101: 'Y', + 0b110101: 'Z', + 0b110100: '0', + 0b10: '1', + 0b110: '2', + 0b10010: '3', + 0b110010: '4', + 0b100010: '5', + 0b10110: '6', + 0b110110: '7', + 0b100110: '8', + 0b10100: '9' +}; + +/** + * Maps a braille chord pattern to a standard key code. + * @type {!Object<number, string>} + */ +cvox.BrailleKeyEvent.brailleChordsToStandardKeyCode = { + 0b1000000: 'Backspace', + 0b10100: 'Tab', + 0b110101: 'Escape', + 0b101000: 'Enter' +}; + +/** + * Maps a braille dot chord pattern to standard key modifiers. + */ +cvox.BrailleKeyEvent.brailleDotsToModifiers = { + 0b010010: {ctrlKey: true}, + 0b100100: {altKey: true}, + 0b1000100: {shiftKey: true}, + 0b1010010: {ctrlKey: true, shiftKey: true}, + 0b1100100: {altKey: true, shiftKey: true} +}; + /** * Map from DOM level 4 key codes to legacy numeric key codes. @@ -113,11 +195,23 @@ 'PageDown': 34, 'End': 35, 'Insert': 45, - 'Delete': 46 + 'Delete': 46, + 'AudioVolumeDown': 174, + 'AudioVolumeUp': 175 }; -// Add the F1 to F12 keys. (function() { + // Add 0-9. + for (var i = '0'.charCodeAt(0); i < '9'.charCodeAt(0); ++i) { + cvox.BrailleKeyEvent.legacyKeyCodeMap_[String.fromCharCode(i)] = i; + } + + // Add A-Z. + for (var i = 'A'.charCodeAt(0); i < 'Z'.charCodeAt(0); ++i) { + cvox.BrailleKeyEvent.legacyKeyCodeMap_[String.fromCharCode(i)] = i; + } + + // Add the F1 to F12 keys. for (var i = 0; i < 12; ++i) { cvox.BrailleKeyEvent.legacyKeyCodeMap_['F' + (i + 1)] = 112 + i; }
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/liblouis_test.extjs b/chrome/browser/resources/chromeos/chromevox/braille/liblouis_test.extjs index 38d1e4b..90c6da9 100644 --- a/chrome/browser/resources/chromeos/chromevox/braille/liblouis_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/braille/liblouis_test.extjs
@@ -166,3 +166,25 @@ liblouis.detach(); }); }); + +TEST_F('CvoxLibLouisTest', 'testKeyEventStaticData', function() { + var liblouis = this.createAndAttachLiblouis(); + this.withTranslator(liblouis, 'en-us-comp8.ctb', function(translator) { + translator.translate('abcdefghijklmnopqrstuvwxyz 0123456789', + this.newCallback( + function(cells, textToBraille, brailleToText) { + // A-Z. + var view = new Uint8Array(cells); + for (var i = 0; i < 26; i++) { + assertEquals(String.fromCharCode(i + 65), + cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode[view[i]]); + } + + // 0-9. + for (var i = 27; i < 37; i++) { + assertEquals(String.fromCharCode(i + 21), + cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode[view[i]]); + } + })); + }); +});
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_background.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_background.js index 45383bc..a6d3e8c3 100644 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_background.js +++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_background.js
@@ -8,6 +8,7 @@ goog.provide('cvox.BrailleBackground'); +goog.require('BrailleKeyEventRewriter'); goog.require('ChromeVoxState'); goog.require('cvox.BrailleDisplayManager'); goog.require('cvox.BrailleInputHandler'); @@ -15,7 +16,6 @@ goog.require('cvox.BrailleKeyEvent'); goog.require('cvox.BrailleTranslatorManager'); - /** * @constructor * @param {cvox.BrailleDisplayManager=} opt_displayManagerForTest @@ -61,6 +61,9 @@ /** @private {boolean} */ this.frozen_ = false; + + /** @private {BrailleKeyEventRewriter} */ + this.keyEventRewriter_ = new BrailleKeyEventRewriter(); }; goog.addSingletonGetter(cvox.BrailleBackground); @@ -149,6 +152,10 @@ */ cvox.BrailleBackground.prototype.onBrailleKeyEvent_ = function( brailleEvt, content) { + if (this.keyEventRewriter_.onBrailleKeyEvent(brailleEvt)) { + return; + } + if (this.inputHandler_.onBrailleKeyEvent(brailleEvt)) { return; }
diff --git a/chrome/browser/resources/chromeos/chromevox/tools/jscompilerwrapper.py b/chrome/browser/resources/chromeos/chromevox/tools/jscompilerwrapper.py index fb4b80d..e7be5ad 100755 --- a/chrome/browser/resources/chromeos/chromevox/tools/jscompilerwrapper.py +++ b/chrome/browser/resources/chromeos/chromevox/tools/jscompilerwrapper.py
@@ -64,7 +64,7 @@ args = [_java_executable, '-jar', _CLOSURE_COMPILER_JAR] args.extend(['--compilation_level', 'SIMPLE_OPTIMIZATIONS']) args.extend(['--jscomp_error=%s' % error for error in _JSCOMP_ERRORS]) - args.extend(['--language_in', 'ECMASCRIPT5']) + args.extend(['--language_in', 'ECMASCRIPT6']) args.extend(['--externs=%s' % extern for extern in externs]) args.extend(['--js=%s' % js for js in js_files]) args.extend(['--js_output_file', '/dev/null'])
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.css b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.css index c1609aa..fc762d83 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.css +++ b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.css
@@ -183,11 +183,6 @@ z-index: 1; } -/* TODO(merkulova): remove when webkit crbug.com/126479 is fixed. */ -.flip-trick { - transform: translateZ(1px); -} - html[dir=rtl] #flip-photo { left: 8px; right: auto;
diff --git a/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.css b/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.css index 8f4db90..b4c38c1 100644 --- a/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.css +++ b/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.css
@@ -489,11 +489,6 @@ width: 32px; } -/* TODO(merkulova): remove when webkit crbug.com/126479 is fixed. */ -.flip-trick { - transform: translateZ(1px); -} - html[dir=rtl] #supervised-user-creation-flip-photo { left: 8px; right: auto;
diff --git a/chrome/browser/resources/chromeos/user_images_grid.js b/chrome/browser/resources/chromeos/user_images_grid.js index 38a76ed..afbd981 100644 --- a/chrome/browser/resources/chromeos/user_images_grid.js +++ b/chrome/browser/resources/chromeos/user_images_grid.js
@@ -454,8 +454,6 @@ return; this.flipPhoto_ = value; this.previewElement.classList.toggle('flip-x', value); - /* TODO(merkulova): remove when webkit crbug.com/126479 is fixed. */ - this.flipPhotoElement.classList.toggle('flip-trick', value); if (!this.cameraLive) { // Flip current still photo. var e = new Event('photoupdated');
diff --git a/chrome/browser/resources/settings/internet_page/network_siminfo.html b/chrome/browser/resources/settings/internet_page/network_siminfo.html index d300cf8..7ed34a0 100644 --- a/chrome/browser/resources/settings/internet_page/network_siminfo.html +++ b/chrome/browser/resources/settings/internet_page/network_siminfo.html
@@ -84,18 +84,18 @@ $i18n{networkSimChangePin} </paper-button> <paper-toggle-button id="simLockButton" - on-change="onSimLockEnabledChange_" - checked="[[networkProperties.Cellular.SIMLockStatus.LockEnabled]]" + on-change="onSimLockEnabledChange_" checked="{{lockEnabled_}}" aria-labelledby="simLockToggleLabel"> </paper-toggle-button> </div> <!-- Enter PIN dialog --> <dialog is="cr-dialog" id="enterPinDialog" close-text="$i18n{close}" - on-close="onEnterPinDialogClosed_"> + on-cancel="onEnterPinDialogCancel_" + on-close="onEnterPinDialogClose_"> <div class="title">$i18n{networkSimEnterPinTitle}</div> <div class="body"> - <paper-input id="enterPin" class="pin" no-label-float + <paper-input id="enterPin" class="pin" no-label-float autofocus label="$i18n{networkSimEnterPin}"> <iron-a11y-keys keys="enter" on-keys-pressed="sendEnterPin_"> </iron-a11y-keys> @@ -116,7 +116,7 @@ on-close="onChangePinDialogClose_"> <div class="title">$i18n{networkSimChangePinTitle}</div> <div class="body"> - <paper-input id="changePinOld" class="pin" no-label-float + <paper-input id="changePinOld" class="pin" no-label-float autofocus label="$i18n{networkSimEnterOldPin}"> </paper-input> <paper-input id="changePinNew1" class="pin" no-label-float @@ -143,7 +143,7 @@ on-close="onUnlockPinDialogClose_"> <div class="title">$i18n{networkSimLockedTitle}</div> <div class="body"> - <paper-input id="unlockPin" class="pin" no-label-float + <paper-input id="unlockPin" class="pin" no-label-float autofocus label="$i18n{networkSimEnterPin}"> <iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPin_"> </iron-a11y-keys> @@ -167,7 +167,7 @@ <div> Enter the 8-digit PIN Unblocking Key provided by your carrier </div> - <paper-input id="unlockPuk" class="puk" no-label-float + <paper-input id="unlockPuk" class="puk" no-label-float autofocus label="$i18n{networkSimEnterPuk}"> </paper-input> <paper-input id="unlockPin1" class="pin" no-label-float
diff --git a/chrome/browser/resources/settings/internet_page/network_siminfo.js b/chrome/browser/resources/settings/internet_page/network_siminfo.js index 9d8b710..1dc2ef75 100644 --- a/chrome/browser/resources/settings/internet_page/network_siminfo.js +++ b/chrome/browser/resources/settings/internet_page/network_siminfo.js
@@ -40,6 +40,16 @@ networkingPrivate: Object, /** + * Reflects networkProperties.Cellular.SIMLockStatus.LockEnabled for the + * toggle button. + * @private + */ + lockEnabled_: { + type: Boolean, + value: false, + }, + + /** * Set to true when a PUK is required to unlock the SIM. * @private */ @@ -61,14 +71,17 @@ sendSimLockEnabled_: false, + /** @private */ networkPropertiesChanged_: function() { if (!this.networkProperties || !this.networkProperties.Cellular) return; var simLockStatus = this.networkProperties.Cellular.SIMLockStatus; this.pukRequired_ = !!simLockStatus && simLockStatus.LockType == CrOnc.LockType.PUK; + this.lockEnabled_ = simLockStatus.LockEnabled; }, + /** @private */ pukRequiredChanged_: function() { if (this.$.unlockPukDialog.open) { if (this.pukRequired_) @@ -112,8 +125,8 @@ return; this.sendSimLockEnabled_ = event.target.checked; this.error_ = ErrorType.NONE; - this.$.enterPinDialog.showModal(); this.$.enterPin.value = ''; + this.$.enterPinDialog.showModal(); }, /** @@ -124,9 +137,10 @@ sendEnterPin_: function(event) { var guid = (this.networkProperties && this.networkProperties.GUID) || ''; var pin = this.$.enterPin.value; - if (!this.validatePin_(pin)) + if (!this.validatePin_(pin)) { + this.onEnterPinDialogCancel_(); return; - + } var simState = /** @type {!CrOnc.CellularSimState} */ ({ currentPin: pin, requirePin: this.sendSimLockEnabled_, @@ -152,10 +166,10 @@ return; event.preventDefault(); this.error_ = ErrorType.NONE; - this.$.changePinDialog.showModal(); this.$.changePinOld.value = ''; this.$.changePinNew1.value = ''; this.$.changePinNew2.value = ''; + this.$.changePinDialog.showModal(); }, /** @@ -193,8 +207,8 @@ onUnlockPinTap_: function(event) { event.preventDefault(); this.error_ = ErrorType.NONE; - this.$.unlockPinDialog.showModal(); this.$.unlockPin.value = ''; + this.$.unlockPinDialog.showModal(); }, /** @@ -340,7 +354,13 @@ }, /** @private */ - onEnterPinDialogClosed_: function() { + onEnterPinDialogCancel_: function() { + this.lockEnabled_ = + this.networkProperties.Cellular.SIMLockStatus.LockEnabled; + }, + + /** @private */ + onEnterPinDialogClose_: function() { this.$$('#simLockButton').focus(); },
diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc index 31c0f5a7..fd894ec 100644 --- a/chrome/browser/signin/signin_ui_util.cc +++ b/chrome/browser/signin/signin_ui_util.cc
@@ -14,8 +14,6 @@ #include "chrome/browser/signin/signin_global_error_factory.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" -#include "chrome/browser/sync/sync_global_error.h" -#include "chrome/browser/sync/sync_global_error_factory.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_navigator_params.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc b/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc index 16df901..cc5ecea 100644 --- a/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc +++ b/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc
@@ -8,6 +8,8 @@ #include "chrome/browser/profiles/profile.h" #if !defined(OS_ANDROID) #include "chrome/browser/sync/sessions/browser_list_router_helper.h" +#else +#include "chrome/browser/android/tab_android.h" #endif // !defined(OS_ANDROID) #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -16,6 +18,22 @@ namespace sync_sessions { +namespace { + +SyncedTabDelegate* GetSyncedTabDelegateFromWebContents( + content::WebContents* web_contents) { +#if defined(OS_ANDROID) + TabAndroid* tab = TabAndroid::FromWebContents(web_contents); + return tab ? tab->GetSyncedTabDelegate() : nullptr; +#else + SyncedTabDelegate* delegate = + TabContentsSyncedTabDelegate::FromWebContents(web_contents); + return delegate; +#endif +} + +} // namespace + SyncSessionsWebContentsRouter::SyncSessionsWebContentsRouter(Profile* profile) { history::HistoryService* history_service = HistoryServiceFactory::GetForProfile(profile, @@ -37,7 +55,7 @@ content::WebContents* web_contents) { if (handler_ && web_contents) { SyncedTabDelegate* delegate = - TabContentsSyncedTabDelegate::FromWebContents(web_contents); + GetSyncedTabDelegateFromWebContents(web_contents); if (delegate) handler_->OnLocalTabModified(delegate); }
diff --git a/chrome/browser/sync/sync_global_error.cc b/chrome/browser/sync/sync_global_error.cc deleted file mode 100644 index ee37b78..0000000 --- a/chrome/browser/sync/sync_global_error.cc +++ /dev/null
@@ -1,94 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/sync/sync_global_error.h" - -#include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/sync/sync_ui_util.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_commands.h" -#include "chrome/browser/ui/chrome_pages.h" -#include "chrome/browser/ui/webui/signin/login_ui_service.h" -#include "chrome/common/url_constants.h" -#include "chrome/grit/generated_resources.h" -#include "components/browser_sync/profile_sync_service.h" -#include "components/signin/core/common/profile_management_switches.h" -#include "google_apis/gaia/google_service_auth_error.h" -#include "ui/base/l10n/l10n_util.h" - -SyncGlobalError::SyncGlobalError( - LoginUIService* login_ui_service, - syncer::SyncErrorController* error_controller, - browser_sync::ProfileSyncService* profile_sync_service) - : login_ui_service_(login_ui_service), - error_controller_(error_controller), - sync_service_(profile_sync_service) { - DCHECK(sync_service_); - error_controller_->AddObserver(this); -} - -SyncGlobalError::~SyncGlobalError() { - DCHECK(!error_controller_) - << "SyncGlobalError::Shutdown() was not called"; -} - -void SyncGlobalError::Shutdown() { - error_controller_->RemoveObserver(this); - error_controller_ = nullptr; -} - -bool SyncGlobalError::HasMenuItem() { - return !menu_label_.empty(); -} - -int SyncGlobalError::MenuItemCommandID() { - return IDC_SHOW_SYNC_ERROR; -} - -base::string16 SyncGlobalError::MenuItemLabel() { - return menu_label_; -} - -void SyncGlobalError::ExecuteMenuItem(Browser* browser) { - if (login_ui_service_->current_login_ui()) { - login_ui_service_->current_login_ui()->FocusUI(); - return; - } - // Need to navigate to the settings page and display the UI. - chrome::ShowSettingsSubPage(browser, chrome::kSyncSetupSubPage); -} - -bool SyncGlobalError::HasBubbleView() { - return !bubble_message_.empty() && !bubble_accept_label_.empty(); -} - -base::string16 SyncGlobalError::GetBubbleViewTitle() { - return l10n_util::GetStringUTF16(IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE); -} - -std::vector<base::string16> SyncGlobalError::GetBubbleViewMessages() { - return std::vector<base::string16>(1, bubble_message_); -} - -base::string16 SyncGlobalError::GetBubbleViewAcceptButtonLabel() { - return bubble_accept_label_; -} - -base::string16 SyncGlobalError::GetBubbleViewCancelButtonLabel() { - return base::string16(); -} - -void SyncGlobalError::OnBubbleViewDidClose(Browser* browser) { -} - -void SyncGlobalError::BubbleViewAcceptButtonPressed(Browser* browser) { - ExecuteMenuItem(browser); -} - -void SyncGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { - NOTREACHED(); -} - -void SyncGlobalError::OnErrorChanged() { -}
diff --git a/chrome/browser/sync/sync_global_error.h b/chrome/browser/sync/sync_global_error.h deleted file mode 100644 index 40726ca..0000000 --- a/chrome/browser/sync/sync_global_error.h +++ /dev/null
@@ -1,68 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ -#define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ - -#include <vector> - -#include "base/compiler_specific.h" -#include "base/macros.h" -#include "chrome/browser/ui/global_error/global_error.h" -#include "components/keyed_service/core/keyed_service.h" -#include "components/sync/driver/sync_error_controller.h" - -class LoginUIService; - -namespace browser_sync { -class ProfileSyncService; -} // namespace browser_sync - -// Shows sync errors on the wrench menu using a bubble view and a menu item. -class SyncGlobalError : public GlobalErrorWithStandardBubble, - public syncer::SyncErrorController::Observer, - public KeyedService { - public: - SyncGlobalError(LoginUIService* login_ui_service, - syncer::SyncErrorController* error_controller, - browser_sync::ProfileSyncService* profile_sync_service); - ~SyncGlobalError() override; - - // KeyedService: - void Shutdown() override; - - // GlobalErrorWithStandardBubble: - bool HasMenuItem() override; - int MenuItemCommandID() override; - base::string16 MenuItemLabel() override; - void ExecuteMenuItem(Browser* browser) override; - bool HasBubbleView() override; - base::string16 GetBubbleViewTitle() override; - std::vector<base::string16> GetBubbleViewMessages() override; - base::string16 GetBubbleViewAcceptButtonLabel() override; - base::string16 GetBubbleViewCancelButtonLabel() override; - void OnBubbleViewDidClose(Browser* browser) override; - void BubbleViewAcceptButtonPressed(Browser* browser) override; - void BubbleViewCancelButtonPressed(Browser* browser) override; - - // syncer::SyncErrorController::Observer: - void OnErrorChanged() override; - - private: - base::string16 bubble_accept_label_; - base::string16 bubble_message_; - base::string16 menu_label_; - - const LoginUIService* login_ui_service_; - - // The error controller to query for error details. Owned by the - // ProfileSyncService this SyncGlobalError depends on. - syncer::SyncErrorController* error_controller_; - - const browser_sync::ProfileSyncService* sync_service_; - - DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); -}; - -#endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_
diff --git a/chrome/browser/sync/sync_global_error_factory.cc b/chrome/browser/sync/sync_global_error_factory.cc deleted file mode 100644 index 09ca810a..0000000 --- a/chrome/browser/sync/sync_global_error_factory.cc +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/sync/sync_global_error_factory.h" - -#include "chrome/browser/browser_process.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/sync/profile_sync_service_factory.h" -#include "chrome/browser/sync/sync_global_error.h" -#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" -#include "components/browser_sync/profile_sync_service.h" -#include "components/keyed_service/content/browser_context_dependency_manager.h" - -#if defined(USE_ASH) -#include "ash/shell.h" -#endif - -SyncGlobalErrorFactory::SyncGlobalErrorFactory() - : BrowserContextKeyedServiceFactory( - "SyncGlobalError", - BrowserContextDependencyManager::GetInstance()) { - DependsOn(LoginUIServiceFactory::GetInstance()); - DependsOn(ProfileSyncServiceFactory::GetInstance()); -} - -SyncGlobalErrorFactory::~SyncGlobalErrorFactory() {} - -// static -SyncGlobalError* SyncGlobalErrorFactory::GetForProfile( - Profile* profile) { - return static_cast<SyncGlobalError*>( - GetInstance()->GetServiceForBrowserContext(profile, true)); -} - -// static -SyncGlobalErrorFactory* SyncGlobalErrorFactory::GetInstance() { - return base::Singleton<SyncGlobalErrorFactory>::get(); -} - -KeyedService* SyncGlobalErrorFactory::BuildServiceInstanceFor( - content::BrowserContext* context) const { -#if defined(USE_ASH) - if (ash::Shell::HasInstance()) - return nullptr; -#endif - - Profile* profile = static_cast<Profile*>(context); - browser_sync::ProfileSyncService* profile_sync_service = - ProfileSyncServiceFactory::GetForProfile(profile); - - if (!profile_sync_service) - return nullptr; - - syncer::SyncErrorController* sync_error_controller = - profile_sync_service->sync_error_controller(); - if (!sync_error_controller) - return nullptr; - - return new SyncGlobalError(LoginUIServiceFactory::GetForProfile(profile), - sync_error_controller, profile_sync_service); -}
diff --git a/chrome/browser/sync/sync_global_error_factory.h b/chrome/browser/sync/sync_global_error_factory.h deleted file mode 100644 index 2c751387..0000000 --- a/chrome/browser/sync/sync_global_error_factory.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_FACTORY_H_ -#define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_FACTORY_H_ - -#include "base/macros.h" -#include "base/memory/singleton.h" -#include "components/keyed_service/content/browser_context_keyed_service_factory.h" - -class SyncGlobalError; -class Profile; - -// Singleton that owns all SyncGlobalErrors and associates them with -// Profiles. Listens for the Profile's destruction notification and cleans up -// the associated SyncGlobalError. -class SyncGlobalErrorFactory : public BrowserContextKeyedServiceFactory { - public: - // Returns the instance of SyncGlobalError associated with this profile, - // creating one if none exists. In Ash, this will return null. - static SyncGlobalError* GetForProfile(Profile* profile); - - // Returns an instance of the SyncGlobalErrorFactory singleton. - static SyncGlobalErrorFactory* GetInstance(); - - private: - friend struct base::DefaultSingletonTraits<SyncGlobalErrorFactory>; - - SyncGlobalErrorFactory(); - ~SyncGlobalErrorFactory() override; - - // BrowserContextKeyedServiceFactory: - KeyedService* BuildServiceInstanceFor( - content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(SyncGlobalErrorFactory); -}; - -#endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_FACTORY_H_
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 0214354c..0a4e259c 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc
@@ -402,35 +402,6 @@ } #if !defined(OS_CHROMEOS) -void GetStatusLabelsForSyncGlobalError(const ProfileSyncService* service, - base::string16* menu_label, - base::string16* bubble_message, - base::string16* bubble_accept_label) { - DCHECK(menu_label); - DCHECK(bubble_message); - DCHECK(bubble_accept_label); - *menu_label = base::string16(); - *bubble_message = base::string16(); - *bubble_accept_label = base::string16(); - - // Only display an error if we've completed sync setup. - if (!service->IsFirstSetupComplete()) - return; - - // Display a passphrase error if we have one. - if (service->IsPassphraseRequired() && - service->IsPassphraseRequiredForDecryption()) { - // This is not the first machine so ask user to enter passphrase. - *menu_label = l10n_util::GetStringUTF16( - IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM); - *bubble_message = l10n_util::GetStringUTF16( - IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE); - *bubble_accept_label = l10n_util::GetStringUTF16( - IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_ACCEPT); - return; - } -} - AvatarSyncErrorType GetMessagesForAvatarSyncError(Profile* profile, int* content_string_id, int* button_string_id) {
diff --git a/chrome/browser/sync/sync_ui_util.h b/chrome/browser/sync/sync_ui_util.h index 9f976db..fcd841c 100644 --- a/chrome/browser/sync/sync_ui_util.h +++ b/chrome/browser/sync/sync_ui_util.h
@@ -76,15 +76,6 @@ base::string16* link_label); #if !defined(OS_CHROMEOS) -// Gets various labels for the sync global error based on the sync error state. -// |menu_item_label|, |bubble_message|, and |bubble_accept_label| must not be -// null. Note that we don't use SyncGlobalError on Chrome OS. -void GetStatusLabelsForSyncGlobalError( - const browser_sync::ProfileSyncService* service, - base::string16* menu_item_label, - base::string16* bubble_message, - base::string16* bubble_accept_label); - // Gets the error message and button label for the sync errors that should be // exposed to the user through the titlebar avatar button. AvatarSyncErrorType GetMessagesForAvatarSyncError(Profile* profile,
diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index c781939..57d94f5 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc
@@ -59,28 +59,6 @@ const char kTestGaiaId[] = "gaia-id-test_user@test.com"; const char kTestUser[] = "test_user@test.com"; -#if !defined(OS_CHROMEOS) -// Utility function to test that GetStatusLabelsForSyncGlobalError returns -// the correct results for the given states. -void VerifySyncGlobalErrorResult(ProfileSyncServiceMock* service, - GoogleServiceAuthError::State error_state, - bool is_signed_in, - bool is_error) { - EXPECT_CALL(*service, IsFirstSetupComplete()) - .WillRepeatedly(Return(is_signed_in)); - - GoogleServiceAuthError auth_error(error_state); - EXPECT_CALL(*service, GetAuthError()).WillRepeatedly(ReturnRef(auth_error)); - - base::string16 label1, label2, label3; - sync_ui_util::GetStatusLabelsForSyncGlobalError( - service, &label1, &label2, &label3); - EXPECT_EQ(label1.empty(), !is_error); - EXPECT_EQ(label2.empty(), !is_error); - EXPECT_EQ(label3.empty(), !is_error); -} -#endif - } // namespace class SyncUIUtilTest : public testing::Test { @@ -88,93 +66,6 @@ content::TestBrowserThreadBundle thread_bundle_; }; -#if !defined(OS_CHROMEOS) -// Test that GetStatusLabelsForSyncGlobalError returns an error if a -// passphrase is required. -TEST_F(SyncUIUtilTest, PassphraseGlobalError) { - std::unique_ptr<Profile> profile = MakeSignedInTestingProfile(); - ProfileSyncServiceMock service( - CreateProfileSyncServiceParamsForTest(profile.get())); - syncer::SyncEngine::Status status; - EXPECT_CALL(service, QueryDetailedSyncStatus(_)) - .WillRepeatedly(Return(false)); - EXPECT_CALL(service, IsPassphraseRequired()) - .WillRepeatedly(Return(true)); - EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) - .WillRepeatedly(Return(true)); - - VerifySyncGlobalErrorResult(&service, - GoogleServiceAuthError::NONE, - true /* signed in */, - true /* error */); -} - -// Test that GetStatusLabelsForSyncGlobalError returns an error if a -// passphrase is required and not for auth errors. -TEST_F(SyncUIUtilTest, AuthAndPassphraseGlobalError) { - std::unique_ptr<Profile> profile(MakeSignedInTestingProfile()); - ProfileSyncServiceMock service( - CreateProfileSyncServiceParamsForTest(profile.get())); - syncer::SyncEngine::Status status; - EXPECT_CALL(service, QueryDetailedSyncStatus(_)) - .WillRepeatedly(Return(false)); - - EXPECT_CALL(service, IsPassphraseRequired()) - .WillRepeatedly(Return(true)); - EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) - .WillRepeatedly(Return(true)); - EXPECT_CALL(service, IsFirstSetupComplete()).WillRepeatedly(Return(true)); - - GoogleServiceAuthError auth_error( - GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); - EXPECT_CALL(service, GetAuthError()).WillRepeatedly(ReturnRef(auth_error)); - base::string16 menu_label, label2, label3; - sync_ui_util::GetStatusLabelsForSyncGlobalError( - &service, &menu_label, &label2, &label3); - // Make sure we are still displaying the passphrase error badge (don't show - // auth errors through SyncUIUtil). - EXPECT_EQ(menu_label, l10n_util::GetStringUTF16( - IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM)); -} - -// Test that GetStatusLabelsForSyncGlobalError does not indicate errors for -// auth errors (these are reported through SigninGlobalError). -TEST_F(SyncUIUtilTest, AuthStateGlobalError) { - std::unique_ptr<Profile> profile(MakeSignedInTestingProfile()); - ProfileSyncService::InitParams init_params = - CreateProfileSyncServiceParamsForTest(profile.get()); - NiceMock<ProfileSyncServiceMock> service(&init_params); - - syncer::SyncEngine::Status status; - EXPECT_CALL(service, QueryDetailedSyncStatus(_)) - .WillRepeatedly(Return(false)); - - GoogleServiceAuthError::State table[] = { - GoogleServiceAuthError::NONE, - GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, - GoogleServiceAuthError::USER_NOT_SIGNED_UP, - GoogleServiceAuthError::CONNECTION_FAILED, - GoogleServiceAuthError::CAPTCHA_REQUIRED, - GoogleServiceAuthError::ACCOUNT_DELETED, - GoogleServiceAuthError::ACCOUNT_DISABLED, - GoogleServiceAuthError::SERVICE_UNAVAILABLE, - GoogleServiceAuthError::TWO_FACTOR, - GoogleServiceAuthError::REQUEST_CANCELED - }; - - for (size_t i = 0; i < arraysize(table); ++i) { - VerifySyncGlobalErrorResult(&service, - table[i], - true /* signed in */, - false /* no error */); - VerifySyncGlobalErrorResult(&service, - table[i], - false /* not signed in */, - false /* no error */); - } -} -#endif - // TODO(tim): This shouldn't be required. r194857 removed the // AuthInProgress override from FakeSigninManager, which meant this test started // using the "real" SigninManager AuthInProgress logic. Without that override,
diff --git a/chrome/browser/ui/cocoa/browser_window_touch_bar.mm b/chrome/browser/ui/cocoa/browser_window_touch_bar.mm index a840011..d884dd1 100644 --- a/chrome/browser/ui/cocoa/browser_window_touch_bar.mm +++ b/chrome/browser/ui/cocoa/browser_window_touch_bar.mm
@@ -6,6 +6,7 @@ #include <memory> +#include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #import "base/mac/scoped_nsobject.h" #import "base/mac/sdk_forward_declarations.h" @@ -53,16 +54,15 @@ }; // The touch bar's identifier. -const NSTouchBarCustomizationIdentifier kBrowserWindowTouchBarId = - @"BrowserWindowTouchBarId"; +NSString* const kBrowserWindowTouchBarId = @"browser-window"; // Touch bar items identifiers. -const NSTouchBarItemIdentifier kBackForwardTouchId = @"BackForwardTouchId"; -const NSTouchBarItemIdentifier kReloadOrStopTouchId = @"ReloadOrStopTouchId"; -const NSTouchBarItemIdentifier kHomeTouchId = @"HomeTouchId"; -const NSTouchBarItemIdentifier kSearchTouchId = @"SearchTouchId"; -const NSTouchBarItemIdentifier kStarTouchId = @"StarTouchId"; -const NSTouchBarItemIdentifier kNewTabTouchId = @"NewTabTouchId"; +NSString* const kBackForwardTouchId = @"BACK-FWD"; +NSString* const kReloadOrStopTouchId = @"RELOAD-STOP"; +NSString* const kHomeTouchId = @"HOME"; +NSString* const kSearchTouchId = @"SEARCH"; +NSString* const kStarTouchId = @"BOOKMARK"; +NSString* const kNewTabTouchId = @"NEW-TAB"; // The button indexes in the back and forward segment control. const int kBackSegmentIndex = 0; @@ -75,9 +75,8 @@ // The size of the touch bar icons. const int kTouchBarIconSize = 16; -// The width of the search button in the touch bar. -const int kSearchBtnWidthWithHomeBtn = 205; -const int kSearchBtnWidthWithoutHomeBtn = 280; +// The min width of the search button in the touch bar. +const int kSearchBtnMinWidth = 205; // Creates an NSImage from the given VectorIcon. NSImage* CreateNSImageFromIcon(const gfx::VectorIcon& icon, @@ -102,6 +101,18 @@ return button; } +NSString* GetTouchBarId(NSString* const touch_bar_id) { + NSString* chrome_bundle_id = + base::SysUTF8ToNSString(base::mac::BaseBundleID()); + return [NSString stringWithFormat:@"%@.%@", chrome_bundle_id, touch_bar_id]; +} + +NSString* GetTouchBarItemId(NSString* const touch_bar_id, + NSString* const item_id) { + return [NSString + stringWithFormat:@"%@-%@", GetTouchBarId(touch_bar_id), item_id]; +} + TouchBarAction TouchBarActionFromCommand(int command) { switch (command) { case IDC_BACK: @@ -205,22 +216,29 @@ base::scoped_nsobject<NSTouchBar> touchBar( [[NSClassFromString(@"NSTouchBar") alloc] init]); - NSArray* touchBarItemIdentifiers; - if (showHomeButton_.GetValue()) { - touchBarItemIdentifiers = @[ - kBackForwardTouchId, kReloadOrStopTouchId, kHomeTouchId, kSearchTouchId, - kStarTouchId, kNewTabTouchId - ]; - } else { - touchBarItemIdentifiers = @[ - kBackForwardTouchId, kReloadOrStopTouchId, kSearchTouchId, kStarTouchId, - kNewTabTouchId - ]; + NSMutableArray* customIdentifiers = [NSMutableArray arrayWithCapacity:7]; + NSMutableArray* defaultIdentifiers = [NSMutableArray arrayWithCapacity:6]; + + NSArray* touchBarItems = @[ + kBackForwardTouchId, kReloadOrStopTouchId, kHomeTouchId, kSearchTouchId, + kStarTouchId, kNewTabTouchId + ]; + + for (NSString* item in touchBarItems) { + NSString* itemIdentifier = + GetTouchBarItemId(kBrowserWindowTouchBarId, item); + [customIdentifiers addObject:itemIdentifier]; + + // Don't add the home button if it's not shown in the toolbar. + if (showHomeButton_.GetValue() || ![item isEqualTo:kHomeTouchId]) + [defaultIdentifiers addObject:itemIdentifier]; } - [touchBar setCustomizationIdentifier:kBrowserWindowTouchBarId]; - [touchBar setDefaultItemIdentifiers:touchBarItemIdentifiers]; - [touchBar setCustomizationAllowedItemIdentifiers:touchBarItemIdentifiers]; + [customIdentifiers addObject:NSTouchBarItemIdentifierFlexibleSpace]; + + [touchBar setCustomizationIdentifier:GetTouchBarId(kBrowserWindowTouchBarId)]; + [touchBar setDefaultItemIdentifiers:defaultIdentifiers]; + [touchBar setCustomizationAllowedItemIdentifiers:customIdentifiers]; [touchBar setDelegate:self]; return touchBar.autorelease(); @@ -233,23 +251,35 @@ base::scoped_nsobject<NSCustomTouchBarItem> touchBarItem([[NSClassFromString( @"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier]); - if ([identifier isEqualTo:kBackForwardTouchId]) { + if ([identifier hasSuffix:kBackForwardTouchId]) { [touchBarItem setView:[self backOrForwardTouchBarView]]; - } else if ([identifier isEqualTo:kReloadOrStopTouchId]) { + [touchBarItem setCustomizationLabel: + l10n_util::GetNSString( + IDS_TOUCH_BAR_BACK_FORWARD_CUSTOMIZATION_LABEL)]; + } else if ([identifier hasSuffix:kReloadOrStopTouchId]) { const gfx::VectorIcon& icon = isPageLoading_ ? kNavigateStopIcon : kNavigateReloadIcon; int commandId = isPageLoading_ ? IDC_STOP : IDC_RELOAD; int tooltipId = isPageLoading_ ? IDS_TOOLTIP_STOP : IDS_TOOLTIP_RELOAD; [touchBarItem setView:CreateTouchBarButton(icon, self, commandId, tooltipId)]; - } else if ([identifier isEqualTo:kHomeTouchId]) { + [touchBarItem setCustomizationLabel: + l10n_util::GetNSString( + IDS_TOUCH_BAR_STOP_RELOAD_CUSTOMIZATION_LABEL)]; + } else if ([identifier hasSuffix:kHomeTouchId]) { [touchBarItem setView:CreateTouchBarButton(kNavigateHomeIcon, self, IDC_HOME, IDS_TOOLTIP_HOME)]; - } else if ([identifier isEqualTo:kNewTabTouchId]) { + [touchBarItem + setCustomizationLabel:l10n_util::GetNSString( + IDS_TOUCH_BAR_HOME_CUSTOMIZATION_LABEL)]; + } else if ([identifier hasSuffix:kNewTabTouchId]) { [touchBarItem setView:CreateTouchBarButton(kNewTabMacTouchbarIcon, self, IDC_NEW_TAB, IDS_TOOLTIP_NEW_TAB)]; - } else if ([identifier isEqualTo:kStarTouchId]) { + [touchBarItem + setCustomizationLabel:l10n_util::GetNSString( + IDS_TOUCH_BAR_NEW_TAB_CUSTOMIZATION_LABEL)]; + } else if ([identifier hasSuffix:kStarTouchId]) { const gfx::VectorIcon& icon = isStarred_ ? toolbar::kStarActiveIcon : toolbar::kStarIcon; SkColor iconColor = @@ -257,8 +287,13 @@ int tooltipId = isStarred_ ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR; [touchBarItem setView:CreateTouchBarButton(icon, self, IDC_BOOKMARK_PAGE, tooltipId, iconColor)]; - } else if ([identifier isEqualTo:kSearchTouchId]) { + [touchBarItem + setCustomizationLabel:l10n_util::GetNSString( + IDS_TOUCH_BAR_BOOKMARK_CUSTOMIZATION_LABEL)]; + } else if ([identifier hasSuffix:kSearchTouchId]) { [touchBarItem setView:[self searchTouchBarView]]; + [touchBarItem setCustomizationLabel:l10n_util::GetNSString( + IDS_TOUCH_BAR_GOOGLE_SEARCH)]; } return touchBarItem.autorelease(); @@ -329,9 +364,12 @@ action:@selector(executeCommand:)]; searchButton.imageHugsTitle = YES; searchButton.tag = IDC_FOCUS_LOCATION; - int width = showHomeButton_.GetValue() ? kSearchBtnWidthWithHomeBtn - : kSearchBtnWidthWithoutHomeBtn; - [searchButton.widthAnchor constraintEqualToConstant:width].active = YES; + [searchButton.widthAnchor + constraintGreaterThanOrEqualToConstant:kSearchBtnMinWidth] + .active = YES; + [searchButton + setContentHuggingPriority:1.0 + forOrientation:NSLayoutConstraintOrientationHorizontal]; return searchButton; }
diff --git a/chrome/browser/ui/cocoa/fast_resize_view.mm b/chrome/browser/ui/cocoa/fast_resize_view.mm index 82c0b72..b21e7e5a 100644 --- a/chrome/browser/ui/cocoa/fast_resize_view.mm +++ b/chrome/browser/ui/cocoa/fast_resize_view.mm
@@ -16,7 +16,6 @@ if ((self = [super initWithFrame:frameRect])) { ScopedCAActionDisabler disabler; base::scoped_nsobject<CALayer> layer([[CALayer alloc] init]); - [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; [self setLayer:layer]; [self setWantsLayer:YES]; }
diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm index b85b7581..65dbbcc 100644 --- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
@@ -251,17 +251,6 @@ NSViewHeightSizable]; [contentsContainer setNeedsDisplay:YES]; - - // Push the background color down to the RenderWidgetHostView, so that if - // there is a flash between contents appearing, it will be the theme's color, - // not white. - SkColor skBackgroundColor = SK_ColorWHITE; - const ThemeProvider* theme = [[[self view] window] themeProvider]; - if (theme) - skBackgroundColor = theme->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND); - content::RenderWidgetHostView* rwhv = contents_->GetRenderWidgetHostView(); - if (rwhv) - rwhv->SetBackgroundColor(skBackgroundColor); } - (void)updateFullscreenWidgetFrame {
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm index de28b7a..473b4381 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -25,7 +25,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/recovery/recovery_install_global_error_factory.h" #include "chrome/browser/search/search.h" -#include "chrome/browser/sync/sync_global_error_factory.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" @@ -238,7 +237,6 @@ // Browser), so |commands_| may not be valid any more. // Start global error services now so we badge the menu correctly. - SyncGlobalErrorFactory::GetForProfile(profile); RecoveryInstallGlobalErrorFactory::GetForProfile(profile); } return self;
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc index f1ba71f..068a3066 100644 --- a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc
@@ -25,8 +25,7 @@ ResetEventObserver(DialogEvent::DIALOG_CLOSED); PayWithCreditCardAndWait(base::ASCIIToUTF16("012")); - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"cardSecurityCode\": \"012\"")}); + ExpectBodyContains({"\"cardSecurityCode\": \"012\""}); } } // namespace payments
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.h b/chrome/browser/ui/views/payments/order_summary_view_controller.h index b62e3cf..4f90b48 100644 --- a/chrome/browser/ui/views/payments/order_summary_view_controller.h +++ b/chrome/browser/ui/views/payments/order_summary_view_controller.h
@@ -31,7 +31,6 @@ ~OrderSummaryViewController() override; // PaymentRequestSpec::Observer: - void OnInvalidSpecProvided() override {} void OnSpecUpdated() override; // PaymentRequestState::Observer:
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_browsertest.cc index dd271aa7..7d3fed25 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_browsertest.cc
@@ -118,20 +118,39 @@ WaitForObservedEvent(); // The actual structure of the card response is unit-tested. - ExpectBodyContains(std::vector<base::string16>{ - card.GetRawInfo(autofill::CREDIT_CARD_NUMBER), - card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL), - card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH), - card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)}); - ExpectBodyContains(std::vector<base::string16>{ - billing_address.GetRawInfo(autofill::NAME_FIRST), - billing_address.GetRawInfo(autofill::NAME_LAST), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE1), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE2), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_ZIP), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_CITY), - billing_address.GetRawInfo(autofill::ADDRESS_HOME_STATE)}); + ExpectBodyContains({card.GetRawInfo(autofill::CREDIT_CARD_NUMBER), + card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL), + card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH), + card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)}); + ExpectBodyContains( + {billing_address.GetRawInfo(autofill::NAME_FIRST), + billing_address.GetRawInfo(autofill::NAME_LAST), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE1), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE2), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_ZIP), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_CITY), + billing_address.GetRawInfo(autofill::ADDRESS_HOME_STATE)}); +} + +IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, InvalidSSL) { + SetInvalidSsl(); + + autofill::AutofillProfile billing_address = autofill::test::GetFullProfile(); + AddAutofillProfile(billing_address); + autofill::CreditCard card = autofill::test::GetCreditCard(); + card.set_billing_address_id(billing_address.guid()); + AddCreditCard(card); // Visa. + + ResetEventObserver(DialogEvent::NOT_SUPPORTED_ERROR); + + EXPECT_TRUE(content::ExecuteScript( + GetActiveWebContents(), + "(function() { document.getElementById('buy').click(); })();")); + + WaitForObservedEvent(); + + ExpectBodyContains({"NotSupportedError"}); } class PaymentRequestAbortTest : public PaymentRequestBrowserTestBase {
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc index 1be7e70..6364f744 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc +++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" +#include <algorithm> #include <memory> #include <string> #include <utility> @@ -54,7 +55,8 @@ const std::string& test_file_path) : test_file_path_(test_file_path), delegate_(nullptr), - incognito_for_testing_(false) {} + is_incognito_(false), + is_valid_ssl_(true) {} PaymentRequestBrowserTestBase::~PaymentRequestBrowserTestBase() {} void PaymentRequestBrowserTestBase::SetUpCommandLine( @@ -87,8 +89,12 @@ base::Unretained(this), web_contents)); } -void PaymentRequestBrowserTestBase::SetIncognitoForTesting() { - incognito_for_testing_ = true; +void PaymentRequestBrowserTestBase::SetIncognito() { + is_incognito_ = true; +} + +void PaymentRequestBrowserTestBase::SetInvalidSsl() { + is_valid_ssl_ = false; } void PaymentRequestBrowserTestBase::OnCanMakePaymentCalled() { @@ -96,6 +102,11 @@ event_observer_->Observe(DialogEvent::CAN_MAKE_PAYMENT_CALLED); } +void PaymentRequestBrowserTestBase::OnNotSupportedError() { + if (event_observer_) + event_observer_->Observe(DialogEvent::NOT_SUPPORTED_ERROR); +} + void PaymentRequestBrowserTestBase::OnDialogOpened() { if (event_observer_) event_observer_->Observe(DialogEvent::DIALOG_OPENED); @@ -188,7 +199,7 @@ } void PaymentRequestBrowserTestBase::ExpectBodyContains( - const std::vector<base::string16>& expected_strings) { + const std::vector<std::string>& expected_strings) { content::WebContents* web_contents = GetActiveWebContents(); const std::string extract_contents_js = "(function() { " @@ -197,13 +208,21 @@ std::string contents; EXPECT_TRUE(content::ExecuteScriptAndExtractString( web_contents, extract_contents_js, &contents)); - for (const auto expected_string : expected_strings) { - EXPECT_NE(std::string::npos, - contents.find(base::UTF16ToUTF8(expected_string))) + for (const std::string& expected_string : expected_strings) { + EXPECT_NE(std::string::npos, contents.find(expected_string)) << "String not present: " << expected_string; } } +void PaymentRequestBrowserTestBase::ExpectBodyContains( + const std::vector<base::string16>& expected_strings) { + std::vector<std::string> converted(expected_strings.size()); + std::transform(expected_strings.begin(), expected_strings.end(), + converted.begin(), + [](const base::string16& s) { return base::UTF16ToUTF8(s); }); + ExpectBodyContains(converted); +} + void PaymentRequestBrowserTestBase::OpenOrderSummaryScreen() { ResetEventObserver(DialogEvent::ORDER_SUMMARY_OPENED); @@ -336,7 +355,7 @@ std::unique_ptr<TestChromePaymentRequestDelegate> delegate = base::MakeUnique<TestChromePaymentRequestDelegate>( web_contents, this /* observer */, this /* widget_observer */, - incognito_for_testing_); + is_incognito_, is_valid_ssl_); delegate_ = delegate.get(); PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents) ->CreatePaymentRequest(web_contents, std::move(delegate),
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h index dd39f3b..634e5067 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h +++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
@@ -71,10 +71,12 @@ void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; - void SetIncognitoForTesting(); + void SetIncognito(); + void SetInvalidSsl(); // PaymentRequest::ObserverForTest: void OnCanMakePaymentCalled() override; + void OnNotSupportedError() override; // PaymentRequestDialogView::ObserverForTest: void OnDialogOpened() override; @@ -101,6 +103,7 @@ void InvokePaymentRequestUI(); // Will expect that all strings in |expected_strings| are present in output. + void ExpectBodyContains(const std::vector<std::string>& expected_strings); void ExpectBodyContains(const std::vector<base::string16>& expected_strings); // Utility functions that will click on Dialog views and wait for the @@ -205,6 +208,7 @@ ERROR_MESSAGE_SHOWN, SPEC_DONE_UPDATING, CVC_PROMPT_SHOWN, + NOT_SUPPORTED_ERROR, }; // DialogEventObserver is used to wait on specific events that may have @@ -251,7 +255,8 @@ std::unique_ptr<net::EmbeddedTestServer> https_server_; // Weak, owned by the PaymentRequest object. TestChromePaymentRequestDelegate* delegate_; - bool incognito_for_testing_; + bool is_incognito_; + bool is_valid_ssl_; DISALLOW_COPY_AND_ASSIGN(PaymentRequestBrowserTestBase); };
diff --git a/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc index bc9b96d..cb4e072 100644 --- a/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
@@ -38,21 +38,35 @@ CallCanMakePayment(); - ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("true")}); + ExpectBodyContains({"true"}); } -// Visa is required, user has a visa instrument, and user is in incognito -// mode. +// Pages without a valid SSL cerificate always get "false" from +// .canMakePayment(). IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest, - CanMakePayment_Supported_InIncognitoMode) { - SetIncognitoForTesting(); + CanMakePayment_InvalidSSL) { + SetInvalidSsl(); const autofill::CreditCard card = autofill::test::GetCreditCard(); // Visa. AddCreditCard(card); CallCanMakePayment(); - ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("true")}); + ExpectBodyContains({"false"}); +} + +// Visa is required, user has a visa instrument, and user is in incognito +// mode. +IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest, + CanMakePayment_Supported_InIncognitoMode) { + SetIncognito(); + + const autofill::CreditCard card = autofill::test::GetCreditCard(); // Visa. + AddCreditCard(card); + + CallCanMakePayment(); + + ExpectBodyContains({"true"}); } // Visa is required, and user doesn't have a visa instrument. @@ -63,14 +77,14 @@ CallCanMakePayment(); - ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("false")}); + ExpectBodyContains({"false"}); } // Visa is required, user doesn't have a visa instrument and the user is in // incognito mode. In this case canMakePayment always returns true. IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest, CanMakePayment_NotSupported_InIncognitoMode) { - SetIncognitoForTesting(); + SetIncognito(); const autofill::CreditCard card = autofill::test::GetCreditCard2(); // Amex. AddCreditCard(card); @@ -79,7 +93,7 @@ // Returns true because the user is in incognito mode, even though it should // return false in a normal profile. - ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("true")}); + ExpectBodyContains({"true"}); } } // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h index 8303b90..8273990 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -91,7 +91,6 @@ void ShowErrorMessage() override; // PaymentRequestSpec::Observer: - void OnInvalidSpecProvided() override {} void OnSpecUpdated() override; void Pay();
diff --git a/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc new file mode 100644 index 0000000..7db7507 --- /dev/null +++ b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace payments { + +class PaymentRequestPaymentAppTest : public PaymentRequestBrowserTestBase { + protected: + PaymentRequestPaymentAppTest() + : PaymentRequestBrowserTestBase("/payment_request_bobpay_test.html") {} + + private: + DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentAppTest); +}; + +IN_PROC_BROWSER_TEST_F(PaymentRequestPaymentAppTest, ShowNotSupportedError) { + ResetEventObserver(DialogEvent::NOT_SUPPORTED_ERROR); + ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), "buy();")); + WaitForObservedEvent(); + ExpectBodyContains({"NotSupportedError"}); +} + +} // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc index f6d22b31..dbd458f 100644 --- a/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc
@@ -48,24 +48,17 @@ PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); // Test that the card details were sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"cardNumber\": \"4111111111111111\""), - base::UTF8ToUTF16("\"cardSecurityCode\": \"123\""), - base::UTF8ToUTF16("\"cardholderName\": \"Test User\""), - base::UTF8ToUTF16("\"expiryMonth\": \"11\""), - base::UTF8ToUTF16("\"expiryYear\": \"2022\"")}); + ExpectBodyContains({"\"cardNumber\": \"4111111111111111\"", + "\"cardSecurityCode\": \"123\"", + "\"cardholderName\": \"Test User\"", + "\"expiryMonth\": \"11\"", "\"expiryYear\": \"2022\""}); // Test that the billing address was sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"billingAddress\": {"), - base::UTF8ToUTF16("\"666 Erebus St.\""), base::UTF8ToUTF16("\"Apt 8\""), - base::UTF8ToUTF16("\"city\": \"Elysium\""), - base::UTF8ToUTF16("\"country\": \"US\""), - base::UTF8ToUTF16("\"organization\": \"Underworld\""), - base::UTF8ToUTF16("\"phone\": \"16502111111\""), - base::UTF8ToUTF16("\"postalCode\": \"91111\""), - base::UTF8ToUTF16("\"recipient\": \"John H. Doe\""), - base::UTF8ToUTF16("\"region\": \"CA\"")}); + ExpectBodyContains({"\"billingAddress\": {", "\"666 Erebus St.\"", + "\"Apt 8\"", "\"city\": \"Elysium\"", + "\"country\": \"US\"", "\"organization\": \"Underworld\"", + "\"phone\": \"16502111111\"", "\"postalCode\": \"91111\"", + "\"recipient\": \"John H. Doe\"", "\"region\": \"CA\""}); } class PaymentRequestPaymentResponseShippingAddressTest @@ -103,22 +96,16 @@ PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); // Test that the shipping address was sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"country\": \"US\""), - base::UTF8ToUTF16("\"123 Main Street\""), base::UTF8ToUTF16("\"Unit 1\""), - base::UTF8ToUTF16("\"region\": \"MI\""), - base::UTF8ToUTF16("\"city\": \"Greensdale\""), - base::UTF8ToUTF16("\"dependentLocality\": \"\""), - base::UTF8ToUTF16("\"postalCode\": \"48838\""), - base::UTF8ToUTF16("\"sortingCode\": \"\""), - base::UTF8ToUTF16("\"languageCode\": \"\""), - base::UTF8ToUTF16("\"organization\": \"ACME\""), - base::UTF8ToUTF16("\"recipient\": \"Jane A. Smith\""), - base::UTF8ToUTF16("\"phone\": \"13105557889\"")}); + ExpectBodyContains({"\"country\": \"US\"", "\"123 Main Street\"", + "\"Unit 1\"", "\"region\": \"MI\"", + "\"city\": \"Greensdale\"", "\"dependentLocality\": \"\"", + "\"postalCode\": \"48838\"", "\"sortingCode\": \"\"", + "\"languageCode\": \"\"", "\"organization\": \"ACME\"", + "\"recipient\": \"Jane A. Smith\"", + "\"phone\": \"13105557889\""}); // Test that the shipping option was sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"shippingOption\": \"freeShippingOption\"")}); + ExpectBodyContains({"\"shippingOption\": \"freeShippingOption\""}); } class PaymentRequestPaymentResponseAllContactDetailsTest @@ -149,10 +136,9 @@ PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); // Test that the contact details were sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"payerName\": \"John H. Doe\""), - base::UTF8ToUTF16("\"payerEmail\": \"johndoe@hades.com\""), - base::UTF8ToUTF16("\"payerPhone\": \"+16502111111\"")}); + ExpectBodyContains({"\"payerName\": \"John H. Doe\"", + "\"payerEmail\": \"johndoe@hades.com\"", + "\"payerPhone\": \"+16502111111\""}); } class PaymentRequestPaymentResponseOneContactDetailTest @@ -183,10 +169,9 @@ PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); // Test that the contact details were sent to the merchant. - ExpectBodyContains(std::vector<base::string16>{ - base::UTF8ToUTF16("\"payerName\": null"), - base::UTF8ToUTF16("\"payerEmail\": \"johndoe@hades.com\""), - base::UTF8ToUTF16("\"payerPhone\": null")}); + ExpectBodyContains({"\"payerName\": null", + "\"payerEmail\": \"johndoe@hades.com\"", + "\"payerPhone\": null"}); } } // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.h b/chrome/browser/ui/views/payments/payment_sheet_view_controller.h index bf202f2..b3120d5 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.h +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.h
@@ -29,7 +29,6 @@ ~PaymentSheetViewController() override; // PaymentRequestSpec::Observer: - void OnInvalidSpecProvided() override {} void OnStartUpdating(PaymentRequestSpec::UpdateReason reason) override; void OnSpecUpdated() override;
diff --git a/chrome/browser/ui/views/payments/shipping_option_view_controller.h b/chrome/browser/ui/views/payments/shipping_option_view_controller.h index e7338f1..2cfe104 100644 --- a/chrome/browser/ui/views/payments/shipping_option_view_controller.h +++ b/chrome/browser/ui/views/payments/shipping_option_view_controller.h
@@ -23,7 +23,6 @@ ~ShippingOptionViewController() override; // PaymentRequestSpec::Observer: - void OnInvalidSpecProvided() override {} void OnSpecUpdated() override; private:
diff --git a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc index 914a0df..e884578 100644 --- a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc +++ b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc
@@ -16,12 +16,14 @@ content::WebContents* web_contents, PaymentRequestDialogView::ObserverForTest* observer, views::WidgetObserver* widget_observer, - bool is_incognito) + bool is_incognito, + bool is_valid_ssl) : ChromePaymentRequestDelegate(web_contents), address_input_provider_(nullptr), observer_(observer), widget_observer_(widget_observer), - is_incognito_for_testing_(is_incognito) {} + is_incognito_(is_incognito), + is_valid_ssl_(is_valid_ssl) {} void TestChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) { PaymentRequestDialogView* dialog_view = @@ -36,7 +38,11 @@ } bool TestChromePaymentRequestDelegate::IsIncognito() const { - return is_incognito_for_testing_; + return is_incognito_; +} + +bool TestChromePaymentRequestDelegate::IsSslCertificateValid() { + return is_valid_ssl_; } std::unique_ptr<const ::i18n::addressinput::Source>
diff --git a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h index 633d3fb..7ee6458 100644 --- a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h +++ b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h
@@ -30,7 +30,8 @@ content::WebContents* web_contents, PaymentRequestDialogView::ObserverForTest* observer, views::WidgetObserver* widget_observer, - bool is_incognito); + bool is_incognito, + bool is_valid_ssl); // This class allows tests to provide their own AddressInput data. class AddressInputProvider { @@ -48,6 +49,7 @@ // ChromePaymentRequestDelegate. void ShowDialog(PaymentRequest* request) override; bool IsIncognito() const override; + bool IsSslCertificateValid() override; std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() override; std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() @@ -63,7 +65,8 @@ PaymentRequestDialogView::ObserverForTest* observer_; views::WidgetObserver* widget_observer_; - bool is_incognito_for_testing_; + bool is_incognito_; + bool is_valid_ssl_; DISALLOW_COPY_AND_ASSIGN(TestChromePaymentRequestDelegate); };
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index 240ce199..b69095e 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -83,7 +83,6 @@ #if !defined(OS_CHROMEOS) #include "chrome/browser/signin/signin_global_error_factory.h" -#include "chrome/browser/sync/sync_global_error_factory.h" #endif #if defined(USE_ASH) @@ -238,9 +237,6 @@ #if !defined(OS_CHROMEOS) if (!HasAshShell()) { SigninGlobalErrorFactory::GetForProfile(browser_->profile()); -#if !defined(OS_ANDROID) - SyncGlobalErrorFactory::GetForProfile(browser_->profile()); -#endif } #if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc index 991e384..f8a39d5 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -281,7 +281,6 @@ views::MenuRunner::ASYNC)); } gfx::Rect screen_bounds = source->GetBoundsInScreen(); - screen_bounds.Inset(source->GetInsets()); denial_menu_runner_->RunMenuAt(source->GetWidget(), source, screen_bounds, views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_MOUSE);
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc index 96fe9d3..06f2870 100644 --- a/chrome/browser/win/jumplist.cc +++ b/chrome/browser/win/jumplist.cc
@@ -120,12 +120,13 @@ // Helper method for RunUpdate to create icon files for the asynchrounously // loaded icons. void CreateIconFiles(const base::FilePath& icon_dir, - const ShellLinkItemList& item_list) { + const ShellLinkItemList& item_list, + size_t max_items) { // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. SCOPED_UMA_HISTOGRAM_TIMER("WinJumplist.CreateIconFilesDuration"); for (ShellLinkItemList::const_iterator item = item_list.begin(); - item != item_list.end(); ++item) { + item != item_list.end() && max_items > 0; ++item, --max_items) { base::FilePath icon_path; if (CreateIconFile((*item)->icon_image(), icon_dir, &icon_path)) (*item)->set_icon(icon_path.value(), 0); @@ -177,12 +178,10 @@ // Updates the application JumpList. bool UpdateJumpList(const wchar_t* app_id, + const base::FilePath& icon_dir, const ShellLinkItemList& most_visited_pages, const ShellLinkItemList& recently_closed_pages, IncognitoModePrefs::Availability incognito_availability) { - // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. - SCOPED_UMA_HISTOGRAM_TIMER("WinJumplist.UpdateJumpListDuration"); - // JumpList is implemented only on Windows 7 or later. // So, we should return now when this function is called on earlier versions // of Windows. @@ -209,6 +208,27 @@ recently_closed_items = recently_closed_pages.size(); } + // If JumpListIcons directory doesn't exist (we have tried to create it + // already) or is not empty, skip updating the jumplist icons. The jumplist + // links should be updated anyway, as it doesn't involve disk IO. In this + // case, Chrome's icon will be used for the new links. + + if (base::DirectoryExists(icon_dir) && base::IsDirectoryEmpty(icon_dir)) { + // TODO(chengx): Remove this UMA metric after fixing http://crbug.com/40407. + UMA_HISTOGRAM_COUNTS_100( + "WinJumplist.CreateIconFilesCount", + most_visited_pages.size() + recently_closed_pages.size()); + + // Create icon files for shortcuts in the "Most Visited" category. + CreateIconFiles(icon_dir, most_visited_pages, most_visited_items); + + // Create icon files for shortcuts in the "Recently Closed" category. + CreateIconFiles(icon_dir, recently_closed_pages, recently_closed_items); + } + + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. + SCOPED_UMA_HISTOGRAM_TIMER("WinJumplist.UpdateJumpListDuration"); + // Update the "Most Visited" category of the JumpList if it exists. // This update request is applied into the JumpList when we commit this // transaction. @@ -257,28 +277,10 @@ local_recently_closed_pages = data->recently_closed_pages_; } - // If JumpListIcons directory doesn't exist or is not empty, skip updating the - // jumplist icons. The jumplist links should be updated anyway, as it doesn't - // involve disk IO. - if (base::DirectoryExists(icon_dir) && base::IsDirectoryEmpty(icon_dir)) { - // TODO(chengx): Remove the UMA histogram after fixing - // http://crbug.com/40407. - UMA_HISTOGRAM_COUNTS_100( - "WinJumplist.CreateIconFilesCount", - local_most_visited_pages.size() + local_recently_closed_pages.size()); - - // Create icon files for shortcuts in the "Most Visited" category. - CreateIconFiles(icon_dir, local_most_visited_pages); - - // Create icon files for shortcuts in the "Recently Closed" - // category. - CreateIconFiles(icon_dir, local_recently_closed_pages); - } - // Create a new JumpList and replace the current JumpList with it. The // jumplist links are updated anyway, while the jumplist icons may not as // mentioned above. - UpdateJumpList(app_id.c_str(), local_most_visited_pages, + UpdateJumpList(app_id.c_str(), icon_dir, local_most_visited_pages, local_recently_closed_pages, incognito_availability); }
diff --git a/chrome/browser/win/jumplist_updater.cc b/chrome/browser/win/jumplist_updater.cc index 39bfc1f0..df7c772 100644 --- a/chrome/browser/win/jumplist_updater.cc +++ b/chrome/browser/win/jumplist_updater.cc
@@ -10,6 +10,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/metrics/histogram_macros.h" #include "base/path_service.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" @@ -117,6 +118,9 @@ } bool JumpListUpdater::BeginUpdate() { + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. + SCOPED_UMA_HISTOGRAM_TIMER("WinJumplistUpdater.BeginUpdateDuration"); + // This instance is expected to be one-time-use only. DCHECK(!destination_list_.get()); @@ -153,6 +157,9 @@ } bool JumpListUpdater::CommitUpdate() { + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. + SCOPED_UMA_HISTOGRAM_TIMER("WinJumplistUpdater.CommitUpdateDuration"); + if (!destination_list_.get()) return false; @@ -161,6 +168,9 @@ } bool JumpListUpdater::AddTasks(const ShellLinkItemList& link_items) { + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. + SCOPED_UMA_HISTOGRAM_TIMER("WinJumplistUpdater.AddTasksDuration"); + if (!destination_list_.get()) return false; @@ -198,7 +208,10 @@ bool JumpListUpdater::AddCustomCategory(const std::wstring& category_name, const ShellLinkItemList& link_items, size_t max_items) { - if (!destination_list_.get()) + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. + SCOPED_UMA_HISTOGRAM_TIMER("WinJumplistUpdater.AddCustomCategoryDuration"); + + if (!destination_list_.get()) return false; // Retrieve the absolute path to "chrome.exe".
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index a388079..39c74a6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2157,6 +2157,7 @@ "../browser/ui/views/payments/payment_request_browsertest_base.cc", "../browser/ui/views/payments/payment_request_browsertest_base.h", "../browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc", + "../browser/ui/views/payments/payment_request_payment_app_browsertest.cc", "../browser/ui/views/payments/payment_request_payment_response_browsertest.cc", "../browser/ui/views/payments/payment_sheet_view_controller_browsertest.cc", "../browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc",
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc index 9e5da57..4feb57f4 100644 --- a/components/cronet/url_request_context_config.cc +++ b/components/cronet/url_request_context_config.cc
@@ -47,7 +47,6 @@ const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; const char kQuicMigrateSessionsOnNetworkChange[] = "migrate_sessions_on_network_change"; -const char kQuicPreferAes[] = "prefer_aes"; const char kQuicUserAgentId[] = "user_agent_id"; const char kQuicMigrateSessionsEarly[] = "migrate_sessions_early"; const char kQuicDisableBidirectionalStreams[] = @@ -187,11 +186,6 @@ quic_migrate_sessions_on_network_change); } - bool quic_prefer_aes = false; - if (quic_args->GetBoolean(kQuicPreferAes, &quic_prefer_aes)) { - context_builder->set_quic_prefer_aes(quic_prefer_aes); - } - std::string quic_user_agent_id; if (quic_args->GetString(kQuicUserAgentId, &quic_user_agent_id)) { context_builder->set_quic_user_agent_id(quic_user_agent_id);
diff --git a/components/cronet/url_request_context_config_unittest.cc b/components/cronet/url_request_context_config_unittest.cc index f3d9d05..7157a41 100644 --- a/components/cronet/url_request_context_config_unittest.cc +++ b/components/cronet/url_request_context_config_unittest.cc
@@ -43,7 +43,6 @@ // JSON encoded experimental options. "{\"QUIC\":{\"max_server_configs_stored_in_properties\":2," "\"delay_tcp_race\":true," - "\"prefer_aes\":true," "\"user_agent_id\":\"Custom QUIC UAID\"," "\"idle_connection_timeout_seconds\":300," "\"close_sessions_on_ip_change\":true," @@ -100,9 +99,6 @@ // Check delay_tcp_race. EXPECT_TRUE(params->quic_delay_tcp_race); - // Check prefer_aes. - EXPECT_TRUE(params->quic_prefer_aes); - // Check idle_connection_timeout_seconds. EXPECT_EQ(300, params->quic_idle_connection_timeout_seconds);
diff --git a/components/network_session_configurator/network_session_configurator.cc b/components/network_session_configurator/network_session_configurator.cc index 8ce11b0..b5a4c864 100644 --- a/components/network_session_configurator/network_session_configurator.cc +++ b/components/network_session_configurator/network_session_configurator.cc
@@ -178,11 +178,6 @@ GetVariationParam(quic_trial_params, "disable_disk_cache"), "true"); } -bool ShouldQuicPreferAes(const VariationParameters& quic_trial_params) { - return base::LowerCaseEqualsASCII( - GetVariationParam(quic_trial_params, "prefer_aes"), "true"); -} - bool ShouldForceHolBlocking(const VariationParameters& quic_trial_params) { return base::LowerCaseEqualsASCII( GetVariationParam(quic_trial_params, "force_hol_blocking"), "true"); @@ -345,7 +340,6 @@ ShouldQuicEnableNonBlockingIO(quic_trial_params); params->quic_disable_disk_cache = ShouldQuicDisableDiskCache(quic_trial_params); - params->quic_prefer_aes = ShouldQuicPreferAes(quic_trial_params); params->quic_force_hol_blocking = ShouldForceHolBlocking(quic_trial_params); params->quic_connection_options = GetQuicConnectionOptions(quic_trial_params);
diff --git a/components/network_session_configurator/network_session_configurator_unittest.cc b/components/network_session_configurator/network_session_configurator_unittest.cc index 6272dbc..a0a8bb1 100644 --- a/components/network_session_configurator/network_session_configurator_unittest.cc +++ b/components/network_session_configurator/network_session_configurator_unittest.cc
@@ -77,7 +77,6 @@ EXPECT_FALSE(params_.enable_server_push_cancellation); EXPECT_FALSE(params_.quic_enable_non_blocking_io); EXPECT_FALSE(params_.quic_disable_disk_cache); - EXPECT_FALSE(params_.quic_prefer_aes); EXPECT_TRUE(params_.enable_quic_alternative_service_with_different_host); EXPECT_TRUE(params_.quic_delay_tcp_race); EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); @@ -413,17 +412,6 @@ EXPECT_TRUE(params_.quic_disable_disk_cache); } -TEST_F(NetworkSessionConfiguratorTest, QuicPreferAes) { - std::map<std::string, std::string> field_trial_params; - field_trial_params["prefer_aes"] = "true"; - variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); - base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); - - ParseFieldTrials(); - - EXPECT_TRUE(params_.quic_prefer_aes); -} - TEST_F(NetworkSessionConfiguratorTest, QuicEnableAlternativeServicesFromFieldTrialParams) { std::map<std::string, std::string> field_trial_params;
diff --git a/components/payments/content/BUILD.gn b/components/payments/content/BUILD.gn index ac16b7b5..b267312 100644 --- a/components/payments/content/BUILD.gn +++ b/components/payments/content/BUILD.gn
@@ -30,6 +30,8 @@ static_library("utils") { sources = [ + "origin_security_checker.cc", + "origin_security_checker.h", "payment_details_validation.cc", "payment_details_validation.h", "payment_manifest_downloader.cc",
diff --git a/components/payments/content/android/BUILD.gn b/components/payments/content/android/BUILD.gn index 46d2578..c11f428 100644 --- a/components/payments/content/android/BUILD.gn +++ b/components/payments/content/android/BUILD.gn
@@ -12,6 +12,8 @@ "component_jni_registrar.h", "currency_formatter_android.cc", "currency_formatter_android.h", + "origin_security_checker_android.cc", + "origin_security_checker_android.h", "payment_details_validation_android.cc", "payment_details_validation_android.h", "payment_manifest_downloader_android.cc", @@ -33,6 +35,7 @@ generate_jni("jni_headers") { sources = [ "java/src/org/chromium/components/payments/CurrencyFormatter.java", + "java/src/org/chromium/components/payments/OriginSecurityChecker.java", "java/src/org/chromium/components/payments/PaymentManifestDownloader.java", "java/src/org/chromium/components/payments/PaymentManifestParser.java", "java/src/org/chromium/components/payments/PaymentValidator.java", @@ -43,6 +46,7 @@ android_library("java") { java_files = [ "java/src/org/chromium/components/payments/CurrencyFormatter.java", + "java/src/org/chromium/components/payments/OriginSecurityChecker.java", "java/src/org/chromium/components/payments/PaymentManifestDownloader.java", "java/src/org/chromium/components/payments/PaymentManifestParser.java", "java/src/org/chromium/components/payments/PaymentValidator.java",
diff --git a/components/payments/content/android/component_jni_registrar.cc b/components/payments/content/android/component_jni_registrar.cc index ef6c00a..d95a597 100644 --- a/components/payments/content/android/component_jni_registrar.cc +++ b/components/payments/content/android/component_jni_registrar.cc
@@ -8,6 +8,7 @@ #include "base/android/jni_registrar.h" #include "base/macros.h" #include "components/payments/content/android/currency_formatter_android.h" +#include "components/payments/content/android/origin_security_checker_android.h" #include "components/payments/content/android/payment_details_validation_android.h" #include "components/payments/content/android/payment_manifest_downloader_android.h" #include "components/payments/content/android/payment_manifest_parser_android.h" @@ -17,6 +18,7 @@ static base::android::RegistrationMethod kPaymentsRegisteredMethods[] = { {"CurrencyFormatter", CurrencyFormatterAndroid::Register}, + {"OriginSecurityChecker", RegisterOriginSecurityChecker}, {"PaymentManifestDownloader", RegisterPaymentManifestDownloader}, {"PaymentManifestParser", RegisterPaymentManifestParser}, {"PaymentValidator", RegisterPaymentValidator},
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java b/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java new file mode 100644 index 0000000..7896be16 --- /dev/null +++ b/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.payments; + +import org.chromium.base.annotations.JNINamespace; + +/** Helper for origin security. */ +@JNINamespace("payments") +public class OriginSecurityChecker { + /** + * Returns true for a valid URL from a secure origin, e.g., http://localhost, file://test.html, + * https://bobpay.com. + * + * @param url The URL to check. + * @return Whether the origin of the URL is secure. + */ + public static boolean isOriginSecure(String url) { + return nativeIsOriginSecure(url); + } + + /** + * Returns true for a valid URL with a cryptographic scheme, e.g., HTTPS, HTTPS-SO, WSS. + * + * @param url The URL to check. + * @return Whether the scheme of the URL is cryptographic. + */ + public static boolean isSchemeCryptographic(String url) { + return nativeIsSchemeCryptographic(url); + } + + private OriginSecurityChecker() {} + + private static native boolean nativeIsOriginSecure(String url); + private static native boolean nativeIsSchemeCryptographic(String url); +}
diff --git a/components/payments/content/android/origin_security_checker_android.cc b/components/payments/content/android/origin_security_checker_android.cc new file mode 100644 index 0000000..574859b --- /dev/null +++ b/components/payments/content/android/origin_security_checker_android.cc
@@ -0,0 +1,41 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/payments/content/android/origin_security_checker_android.h" + +#include "base/android/jni_string.h" +#include "base/android/scoped_java_ref.h" +#include "components/payments/content/origin_security_checker.h" +#include "content/public/browser/web_contents.h" +#include "jni/OriginSecurityChecker_jni.h" + +namespace payments { +namespace { + +using ::base::android::JavaParamRef; +using ::base::android::ConvertJavaStringToUTF8; + +} // namespace + +// static +jboolean IsOriginSecure(JNIEnv* env, + const JavaParamRef<jclass>& jcaller, + const JavaParamRef<jstring>& jurl) { + return OriginSecurityChecker::IsOriginSecure( + GURL(ConvertJavaStringToUTF8(env, jurl))); +} + +// static +jboolean IsSchemeCryptographic(JNIEnv* env, + const JavaParamRef<jclass>& jcaller, + const JavaParamRef<jstring>& jurl) { + return OriginSecurityChecker::IsSchemeCryptographic( + GURL(ConvertJavaStringToUTF8(env, jurl))); +} + +bool RegisterOriginSecurityChecker(JNIEnv* env) { + return RegisterNativesImpl(env); +} + +} // namespace payments
diff --git a/components/payments/content/android/origin_security_checker_android.h b/components/payments/content/android/origin_security_checker_android.h new file mode 100644 index 0000000..d441389 --- /dev/null +++ b/components/payments/content/android/origin_security_checker_android.h
@@ -0,0 +1,16 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_ORIGIN_SECURITY_CHECKER_ANDROID_H_ +#define COMPONENTS_PAYMENTS_CONTENT_ANDROID_ORIGIN_SECURITY_CHECKER_ANDROID_H_ + +#include <jni.h> + +namespace payments { + +bool RegisterOriginSecurityChecker(JNIEnv* env); + +} // namespace payments + +#endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_ORIGIN_SECURITY_CHECKER_ANDROID_H_
diff --git a/components/payments/content/origin_security_checker.cc b/components/payments/content/origin_security_checker.cc new file mode 100644 index 0000000..5cede98 --- /dev/null +++ b/components/payments/content/origin_security_checker.cc
@@ -0,0 +1,22 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/payments/content/origin_security_checker.h" + +#include "content/public/common/origin_util.h" +#include "url/gurl.h" + +namespace payments { + +// static +bool OriginSecurityChecker::IsOriginSecure(const GURL& url) { + return url.is_valid() && content::IsOriginSecure(url); +} + +// static +bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) { + return url.is_valid() && url.SchemeIsCryptographic(); +} + +} // namespace payments
diff --git a/components/payments/content/origin_security_checker.h b/components/payments/content/origin_security_checker.h new file mode 100644 index 0000000..b7a640f --- /dev/null +++ b/components/payments/content/origin_security_checker.h
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_ +#define COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_ + +#include "base/macros.h" + +class GURL; + +namespace payments { + +class OriginSecurityChecker { + public: + // Returns true for a valid |url| from a secure origin. + static bool IsOriginSecure(const GURL& url); + + // Returns true for a valid |url| with a cryptographic scheme, e.g., HTTPS, + // HTTPS-SO, WSS. + static bool IsSchemeCryptographic(const GURL& url); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(OriginSecurityChecker); +}; + +} // namespace payments + +#endif // COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc index 15aee2c..2cc645f1 100644 --- a/components/payments/content/payment_request.cc +++ b/components/payments/content/payment_request.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/memory/ptr_util.h" +#include "components/payments/content/origin_security_checker.h" #include "components/payments/content/payment_details_validation.h" #include "components/payments/content/payment_request_web_contents_manager.h" #include "content/public/browser/browser_thread.h" @@ -19,7 +20,7 @@ content::WebContents* web_contents, std::unique_ptr<PaymentRequestDelegate> delegate, PaymentRequestWebContentsManager* manager, - mojo::InterfaceRequest<payments::mojom::PaymentRequest> request, + mojo::InterfaceRequest<mojom::PaymentRequest> request, ObserverForTest* observer_for_testing) : web_contents_(web_contents), delegate_(std::move(delegate)), @@ -37,24 +38,49 @@ PaymentRequest::~PaymentRequest() {} -void PaymentRequest::Init( - payments::mojom::PaymentRequestClientPtr client, - std::vector<payments::mojom::PaymentMethodDataPtr> method_data, - payments::mojom::PaymentDetailsPtr details, - payments::mojom::PaymentOptionsPtr options) { +void PaymentRequest::Init(mojom::PaymentRequestClientPtr client, + std::vector<mojom::PaymentMethodDataPtr> method_data, + mojom::PaymentDetailsPtr details, + mojom::PaymentOptionsPtr options) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + client_ = std::move(client); + + if (!OriginSecurityChecker::IsOriginSecure( + delegate_->GetLastCommittedURL())) { + LOG(ERROR) << "Not in a secure origin"; + OnConnectionTerminated(); + return; + } + + if (OriginSecurityChecker::IsSchemeCryptographic( + delegate_->GetLastCommittedURL()) && + !delegate_->IsSslCertificateValid()) { + LOG(ERROR) << "SSL certificate is not valid"; + // Don't show UI. Resolve .canMakepayment() with "false". Reject .show() + // with "NotSupportedError". + spec_ = base::MakeUnique<PaymentRequestSpec>( + mojom::PaymentOptions::New(), mojom::PaymentDetails::New(), + std::vector<mojom::PaymentMethodDataPtr>(), this, + delegate_->GetApplicationLocale()); + state_ = base::MakeUnique<PaymentRequestState>( + spec_.get(), this, delegate_->GetApplicationLocale(), + delegate_->GetPersonalDataManager(), delegate_.get()); + return; + } + std::string error; - if (!payments::validatePaymentDetails(details, &error)) { + if (!validatePaymentDetails(details, &error)) { LOG(ERROR) << error; OnConnectionTerminated(); return; } + if (!details->total) { LOG(ERROR) << "Missing total"; OnConnectionTerminated(); return; } - client_ = std::move(client); + spec_ = base::MakeUnique<PaymentRequestSpec>( std::move(options), std::move(details), std::move(method_data), this, delegate_->GetApplicationLocale()); @@ -69,12 +95,21 @@ OnConnectionTerminated(); return; } + + if (!state_->AreRequestedMethodsSupported()) { + client_->OnError(mojom::PaymentErrorReason::NOT_SUPPORTED); + if (observer_for_testing_) + observer_for_testing_->OnNotSupportedError(); + OnConnectionTerminated(); + return; + } + delegate_->ShowDialog(this); } void PaymentRequest::UpdateWith(mojom::PaymentDetailsPtr details) { std::string error; - if (!payments::validatePaymentDetails(details, &error)) { + if (!validatePaymentDetails(details, &error)) { LOG(ERROR) << error; OnConnectionTerminated(); return; @@ -114,10 +149,6 @@ observer_for_testing_->OnCanMakePaymentCalled(); } -void PaymentRequest::OnInvalidSpecProvided() { - OnConnectionTerminated(); -} - void PaymentRequest::OnPaymentResponseAvailable( mojom::PaymentResponsePtr response) { client_->OnPaymentResponse(std::move(response)); @@ -140,7 +171,7 @@ return; // This sends an error to the renderer, which informs the API user. - client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); + client_->OnError(mojom::PaymentErrorReason::USER_CANCEL); // We close all bindings and ask to be destroyed. client_.reset();
diff --git a/components/payments/content/payment_request.h b/components/payments/content/payment_request.h index d609c83..9d0ff09 100644 --- a/components/payments/content/payment_request.h +++ b/components/payments/content/payment_request.h
@@ -37,6 +37,7 @@ class ObserverForTest { public: virtual void OnCanMakePaymentCalled() = 0; + virtual void OnNotSupportedError() = 0; protected: virtual ~ObserverForTest() {} @@ -62,7 +63,6 @@ // PaymentRequestSpec::Observer: void OnSpecUpdated() override {} - void OnInvalidSpecProvided() override; // PaymentRequestState::Delegate: void OnPaymentResponseAvailable(mojom::PaymentResponsePtr response) override;
diff --git a/components/payments/content/payment_request_spec.cc b/components/payments/content/payment_request_spec.cc index 6fbfc5f6..5e58552 100644 --- a/components/payments/content/payment_request_spec.cc +++ b/components/payments/content/payment_request_spec.cc
@@ -136,12 +136,6 @@ void PaymentRequestSpec::PopulateValidatedMethodData( const std::vector<mojom::PaymentMethodDataPtr>& method_data_mojom) { - if (method_data_mojom.empty()) { - LOG(ERROR) << "Invalid payment methods or data"; - NotifyOnInvalidSpecProvided(); - return; - } - std::vector<PaymentMethodData> method_data_vector; method_data_vector.reserve(method_data_mojom.size()); for (const mojom::PaymentMethodDataPtr& method_data_entry : @@ -161,13 +155,9 @@ method_data_vector.push_back(std::move(method_data)); } - if (!data_util::ParseBasicCardSupportedNetworks( - method_data_vector, &supported_card_networks_, - &basic_card_specified_networks_)) { - LOG(ERROR) << "Invalid payment methods or data"; - NotifyOnInvalidSpecProvided(); - return; - } + data_util::ParseBasicCardSupportedNetworks(method_data_vector, + &supported_card_networks_, + &basic_card_specified_networks_); supported_card_networks_set_.insert(supported_card_networks_.begin(), supported_card_networks_.end()); } @@ -192,13 +182,6 @@ } } -void PaymentRequestSpec::NotifyOnInvalidSpecProvided() { - for (auto& observer : observers_) - observer.OnInvalidSpecProvided(); - if (observer_for_testing_) - observer_for_testing_->OnInvalidSpecProvided(); -} - void PaymentRequestSpec::NotifyOnSpecUpdated() { for (auto& observer : observers_) observer.OnSpecUpdated();
diff --git a/components/payments/content/payment_request_spec.h b/components/payments/content/payment_request_spec.h index 5d9273b..905cfb5f 100644 --- a/components/payments/content/payment_request_spec.h +++ b/components/payments/content/payment_request_spec.h
@@ -37,9 +37,6 @@ // notification about spec events. class Observer { public: - // Called when the provided spec (details, options, method_data) is invalid. - virtual void OnInvalidSpecProvided() = 0; - // Called when the website is notified that the user selected shipping // options or a shipping address. This will be followed by a call to // OnSpecUpdated or the PaymentRequest being aborted due to a timeout. @@ -118,8 +115,6 @@ // the last option marked selected in the options array. void UpdateSelectedShippingOption(); - // Will notify all observers that the spec is invalid. - void NotifyOnInvalidSpecProvided(); // Will notify all observers that the spec has changed. void NotifyOnSpecUpdated();
diff --git a/components/payments/content/payment_request_spec_unittest.cc b/components/payments/content/payment_request_spec_unittest.cc index f9f2a86f..9a3b9b0 100644 --- a/components/payments/content/payment_request_spec_unittest.cc +++ b/components/payments/content/payment_request_spec_unittest.cc
@@ -17,9 +17,6 @@ protected: ~PaymentRequestSpecTest() override {} - void OnInvalidSpecProvided() override { - on_invalid_spec_provided_called_ = true; - } void OnSpecUpdated() override { on_spec_updated_called_ = true; } void RecreateSpecWithMethodData( @@ -37,21 +34,16 @@ } PaymentRequestSpec* spec() { return spec_.get(); } - bool on_invalid_spec_provided_called() { - return on_invalid_spec_provided_called_; - } private: std::unique_ptr<PaymentRequestSpec> spec_; - bool on_invalid_spec_provided_called_ = false; bool on_spec_updated_called_ = false; }; -// Test that empty method data notifies observers of an invalid spec. +// Test that empty method data is parsed correctly. TEST_F(PaymentRequestSpecTest, EmptyMethodData) { std::vector<mojom::PaymentMethodDataPtr> method_data; RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_TRUE(on_invalid_spec_provided_called()); // No supported card networks. EXPECT_EQ(0u, spec()->supported_card_networks().size()); @@ -127,7 +119,6 @@ method_data.push_back(std::move(entry)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); // Only "visa" and "mastercard" remain, in order. EXPECT_EQ(2u, spec()->supported_card_networks().size()); @@ -151,7 +142,6 @@ method_data.push_back(std::move(entry3)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); // Only "visa" and "mastercard" remain, in order. EXPECT_EQ(2u, spec()->supported_card_networks().size()); @@ -177,7 +167,6 @@ method_data.push_back(std::move(entry3)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_TRUE(on_invalid_spec_provided_called()); // Visa was parsed, but not mastercard. EXPECT_EQ(1u, spec()->supported_card_networks().size()); @@ -192,7 +181,6 @@ method_data.push_back(std::move(entry)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); // All of the basic card networks are supported. EXPECT_EQ(8u, spec()->supported_card_networks().size()); @@ -216,7 +204,6 @@ method_data.push_back(std::move(entry)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); // All of the basic card networks are supported, but JCB is first because it // was specified first. @@ -248,7 +235,6 @@ method_data.push_back(std::move(entry2)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); EXPECT_EQ(3u, spec()->supported_card_networks().size()); EXPECT_EQ("mastercard", spec()->supported_card_networks()[0]); @@ -268,7 +254,6 @@ method_data.push_back(std::move(entry)); RecreateSpecWithMethodData(std::move(method_data)); - EXPECT_FALSE(on_invalid_spec_provided_called()); // Only the specified networks are supported. EXPECT_EQ(2u, spec()->supported_card_networks().size());
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc index c3f1526..aaf180d 100644 --- a/components/payments/content/payment_request_state.cc +++ b/components/payments/content/payment_request_state.cc
@@ -50,15 +50,22 @@ bool PaymentRequestState::CanMakePayment() const { for (const std::unique_ptr<PaymentInstrument>& instrument : available_instruments_) { - if (instrument->IsValidForCanMakePayment() && - spec_->supported_card_networks_set().count( - instrument.get()->method_name())) { + if (instrument->IsValidForCanMakePayment()) { + // AddAutofillPaymentInstrument() filters out available instruments based + // on supported card networks. + DCHECK(spec_->supported_card_networks_set().find( + instrument->method_name()) != + spec_->supported_card_networks_set().end()); return true; } } return false; } +bool PaymentRequestState::AreRequestedMethodsSupported() const { + return !spec_->supported_card_networks().empty(); +} + void PaymentRequestState::AddObserver(Observer* observer) { CHECK(observer); observers_.AddObserver(observer);
diff --git a/components/payments/content/payment_request_state.h b/components/payments/content/payment_request_state.h index dcef090b..37d6282 100644 --- a/components/payments/content/payment_request_state.h +++ b/components/payments/content/payment_request_state.h
@@ -82,6 +82,12 @@ // Returns whether the user has at least one instrument that satisfies the // specified supported payment methods. bool CanMakePayment() const; + + // Returns true if the payment methods that the merchant website have + // requested are supported. For example, may return true for "basic-card", but + // false for "https://bobpay.com". + bool AreRequestedMethodsSupported() const; + void AddObserver(Observer* observer); void RemoveObserver(Observer* observer);
diff --git a/components/payments/content/payment_response_helper_unittest.cc b/components/payments/content/payment_response_helper_unittest.cc index efbe6f3..ed9757c5 100644 --- a/components/payments/content/payment_response_helper_unittest.cc +++ b/components/payments/content/payment_response_helper_unittest.cc
@@ -27,7 +27,9 @@ public: FakePaymentRequestDelegate( autofill::PersonalDataManager* personal_data_manager) - : personal_data_manager_(personal_data_manager), locale_("en-US") {} + : personal_data_manager_(personal_data_manager), + locale_("en-US"), + last_committed_url_("https://shop.com") {} void ShowDialog(PaymentRequest* request) override {} void CloseDialog() override {} @@ -42,6 +44,12 @@ bool IsIncognito() const override { return false; } + bool IsSslCertificateValid() override { return true; } + + const GURL& GetLastCommittedURL() const override { + return last_committed_url_; + } + void DoFullCardRequest( const autofill::CreditCard& credit_card, base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> @@ -63,6 +71,7 @@ private: autofill::PersonalDataManager* personal_data_manager_; std::string locale_; + const GURL last_committed_url_; DISALLOW_COPY_AND_ASSIGN(FakePaymentRequestDelegate); };
diff --git a/components/payments/core/payment_request_data_util.cc b/components/payments/core/payment_request_data_util.cc index 8fb6572..9a5f5f4 100644 --- a/components/payments/core/payment_request_data_util.cc +++ b/components/payments/core/payment_request_data_util.cc
@@ -95,7 +95,7 @@ return response; } -bool ParseBasicCardSupportedNetworks( +void ParseBasicCardSupportedNetworks( const std::vector<PaymentMethodData>& method_data, std::vector<std::string>* out_supported_networks, std::set<std::string>* out_basic_card_specified_networks) { @@ -107,7 +107,7 @@ "unionpay", "visa"}; for (const PaymentMethodData& method_data_entry : method_data) { if (method_data_entry.supported_methods.empty()) - return false; + return; for (const std::string& method : method_data_entry.supported_methods) { if (method.empty()) @@ -153,7 +153,6 @@ } } } - return true; } std::string FormatPhoneForDisplay(const std::string& phone_number,
diff --git a/components/payments/core/payment_request_data_util.h b/components/payments/core/payment_request_data_util.h index f3120c8c..e69807fb 100644 --- a/components/payments/core/payment_request_data_util.h +++ b/components/payments/core/payment_request_data_util.h
@@ -44,11 +44,10 @@ // |out_basic_card_supported_networks| is a subset of |out_supported_networks| // that includes all networks that were specified as part of "basic-card". This // is used to know whether to return the card network name (e.g., "visa") or -// "basic-card" in the PaymentResponse. Returns true on success, false on -// invalid data specified. |method_data.supported_networks| is expected to only -// contain basic-card card network names (the list is at +// "basic-card" in the PaymentResponse. |method_data.supported_networks| is +// expected to only contain basic-card card network names (the list is at // https://www.w3.org/Payments/card-network-ids). -bool ParseBasicCardSupportedNetworks( +void ParseBasicCardSupportedNetworks( const std::vector<PaymentMethodData>& method_data, std::vector<std::string>* out_supported_networks, std::set<std::string>* out_basic_card_supported_networks);
diff --git a/components/payments/core/payment_request_delegate.h b/components/payments/core/payment_request_delegate.h index aab278a..8ebc229 100644 --- a/components/payments/core/payment_request_delegate.h +++ b/components/payments/core/payment_request_delegate.h
@@ -13,6 +13,8 @@ #include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" +class GURL; + namespace i18n { namespace addressinput { class Storage; @@ -53,6 +55,13 @@ // Returns whether the user is in Incognito mode. virtual bool IsIncognito() const = 0; + // Returns true if the SSL certificate is valid. Should be called only for + // cryptographic schemes. + virtual bool IsSslCertificateValid() = 0; + + // Returns the URL of the page that is currently being displayed. + virtual const GURL& GetLastCommittedURL() const = 0; + // Starts a FullCardRequest to unmask |credit_card|. virtual void DoFullCardRequest( const autofill::CreditCard& credit_card,
diff --git a/components/spellcheck/renderer/spellcheck.cc b/components/spellcheck/renderer/spellcheck.cc index cd1a397..cc9b2382 100644 --- a/components/spellcheck/renderer/spellcheck.cc +++ b/components/spellcheck/renderer/spellcheck.cc
@@ -29,15 +29,13 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_visitor.h" #include "content/public/renderer/render_thread.h" -#include "content/public/renderer/render_view.h" -#include "content/public/renderer/render_view_visitor.h" #include "ipc/ipc_platform_file.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebVector.h" +#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebTextCheckingCompletion.h" #include "third_party/WebKit/public/web/WebTextCheckingResult.h" #include "third_party/WebKit/public/web/WebTextDecorationType.h" -#include "third_party/WebKit/public/web/WebView.h" using blink::WebVector; using blink::WebString; @@ -65,11 +63,11 @@ return true; } -class DocumentMarkersRemover : public content::RenderViewVisitor { +class DocumentMarkersRemover : public content::RenderFrameVisitor { public: explicit DocumentMarkersRemover(const std::set<std::string>& words); ~DocumentMarkersRemover() override {} - bool Visit(content::RenderView* render_view) override; + bool Visit(content::RenderFrame* render_frame) override; private: WebVector<WebString> words_; @@ -83,9 +81,10 @@ [](const std::string& w) { return WebString::FromUTF8(w); }); } -bool DocumentMarkersRemover::Visit(content::RenderView* render_view) { - if (render_view && render_view->GetWebView()) - render_view->GetWebView()->RemoveSpellingMarkersUnderWords(words_); +bool DocumentMarkersRemover::Visit(content::RenderFrame* render_frame) { + // TODO(xiaochengh): Both nullptr checks seem unnecessary. + if (render_frame && render_frame->GetWebFrame()) + render_frame->GetWebFrame()->RemoveSpellingMarkersUnderWords(words_); return true; } @@ -220,7 +219,7 @@ if (words_added.empty()) return; DocumentMarkersRemover markersRemover(words_added); - content::RenderView::ForEach(&markersRemover); + content::RenderFrame::ForEach(&markersRemover); } void SpellCheck::OnEnableSpellCheck(bool enable) {
diff --git a/components/sync/driver/backend_migrator.cc b/components/sync/driver/backend_migrator.cc index 7edbbaf..a4c7654 100644 --- a/components/sync/driver/backend_migrator.cc +++ b/components/sync/driver/backend_migrator.cc
@@ -70,11 +70,6 @@ migration_observers_.AddObserver(observer); } -bool BackendMigrator::HasMigrationObserver( - const MigrationObserver* observer) const { - return migration_observers_.HasObserver(observer); -} - void BackendMigrator::RemoveMigrationObserver(MigrationObserver* observer) { migration_observers_.RemoveObserver(observer); }
diff --git a/components/sync/driver/backend_migrator.h b/components/sync/driver/backend_migrator.h index a5c183e..6b1500f 100644 --- a/components/sync/driver/backend_migrator.h +++ b/components/sync/driver/backend_migrator.h
@@ -56,7 +56,6 @@ void MigrateTypes(ModelTypeSet types); void AddMigrationObserver(MigrationObserver* observer); - bool HasMigrationObserver(const MigrationObserver* observer) const; void RemoveMigrationObserver(MigrationObserver* observer); State state() const;
diff --git a/components/sync/driver/model_associator.h b/components/sync/driver/model_associator.h index 173789ff..71cf3189 100644 --- a/components/sync/driver/model_associator.h +++ b/components/sync/driver/model_associator.h
@@ -13,7 +13,6 @@ namespace syncer { -class BaseNode; class SyncMergeResult; // This represents the fundamental operations used for model association that @@ -53,40 +52,6 @@ virtual bool CryptoReadyIfNecessary() = 0; }; -// In addition to the generic methods, association can refer to operations -// that depend on the types of the actual IDs we are associating and the -// underlying node type in the browser. We collect these into a templatized -// interface that encapsulates everything you need to implement to have a model -// associator for a specific data type. -// This template is appropriate for data types where a Node* makes sense for -// referring to a particular item. If we encounter a type that does not fit -// in this world, we may want to have several PerDataType templates. -template <class Node, class IDType> -class PerDataTypeAssociatorInterface : public AssociatorInterface { - public: - virtual ~PerDataTypeAssociatorInterface() {} - // Returns sync id for the given chrome model id. - // Returns kInvalidId if the sync node is not found for the given - // chrome id. - virtual int64_t GetSyncIdFromChromeId(const IDType& id) = 0; - - // Returns the chrome node for the given sync id. - // Returns null if no node is found for the given sync id. - virtual const Node* GetChromeNodeFromSyncId(int64_t sync_id) = 0; - - // Initializes the given sync node from the given chrome node id. - // Returns false if no sync node was found for the given chrome node id or - // if the initialization of sync node fails. - virtual bool InitSyncNodeFromChromeId(const IDType& node_id, - BaseNode* sync_node) = 0; - - // Associates the given chrome node with the given sync node. - virtual void Associate(const Node* node, const BaseNode& sync_node) = 0; - - // Remove the association that corresponds to the given sync id. - virtual void Disassociate(int64_t sync_id) = 0; -}; - } // namespace syncer #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_
diff --git a/components/sync/engine_impl/get_commit_ids.cc b/components/sync/engine_impl/get_commit_ids.cc index 0baa11e..171830f 100644 --- a/components/sync/engine_impl/get_commit_ids.cc +++ b/components/sync/engine_impl/get_commit_ids.cc
@@ -15,76 +15,14 @@ #include "components/sync/syncable/syncable_base_transaction.h" #include "components/sync/syncable/syncable_util.h" -using std::set; -using std::vector; - namespace syncer { -namespace { - -// Forward-declare some helper functions. This gives us more options for -// ordering the function defintions within this file. - -// Filters |unsynced_handles| to remove all entries that do not belong to the -// specified |requested_types|, or are not eligible for a commit at this time. -void FilterUnreadyEntries( - syncable::BaseTransaction* trans, - ModelTypeSet requested_types, - ModelTypeSet encrypted_types, - bool passphrase_missing, - const syncable::Directory::Metahandles& unsynced_handles, - std::set<int64_t>* ready_unsynced_set); - -// Given a set of commit metahandles that are ready for commit -// (|ready_unsynced_set|), sorts these into commit order and places up to -// |max_entries| of them in the output parameter |out|. -// -// See the header file for an explanation of commit ordering. -void OrderCommitIds(syncable::BaseTransaction* trans, - size_t max_entries, - const std::set<int64_t>& ready_unsynced_set, - std::vector<int64_t>* out); - -} // namespace - -void GetCommitIdsForType(syncable::BaseTransaction* trans, - ModelType type, - size_t max_entries, - syncable::Directory::Metahandles* out) { - syncable::Directory* dir = trans->directory(); - - // Gather the full set of unsynced items and store it in the cycle. They - // are not in the correct order for commit. - std::set<int64_t> ready_unsynced_set; - syncable::Directory::Metahandles all_unsynced_handles; - GetUnsyncedEntries(trans, &all_unsynced_handles); - - ModelTypeSet encrypted_types; - bool passphrase_missing = false; - Cryptographer* cryptographer = dir->GetCryptographer(trans); - if (cryptographer) { - encrypted_types = dir->GetNigoriHandler()->GetEncryptedTypes(trans); - passphrase_missing = cryptographer->has_pending_keys(); - } - - // We filter out all unready entries from the set of unsynced handles. This - // new set of ready and unsynced items is then what we use to determine what - // is a candidate for commit. The caller is responsible for ensuring that no - // throttled types are included among the requested_types. - FilterUnreadyEntries(trans, ModelTypeSet(type), encrypted_types, - passphrase_missing, all_unsynced_handles, - &ready_unsynced_set); - - OrderCommitIds(trans, max_entries, ready_unsynced_set, out); - - for (size_t i = 0; i < out->size(); i++) { - DVLOG(1) << "Debug commit batch result:" << (*out)[i]; - } -} +using syncable::Directory; +using syncable::Entry; namespace { -bool IsEntryInConflict(const syncable::Entry& entry) { +bool IsEntryInConflict(const Entry& entry) { if (entry.GetIsUnsynced() && entry.GetServerVersion() > 0 && (entry.GetServerVersion() > entry.GetBaseVersion())) { // The local and server versions don't match. The item must be in @@ -98,7 +36,7 @@ // Return true if this entry has any attachments that haven't yet been uploaded // to the server. -bool HasAttachmentNotOnServer(const syncable::Entry& entry) { +bool HasAttachmentNotOnServer(const Entry& entry) { const sync_pb::AttachmentMetadata& metadata = entry.GetAttachmentMetadata(); for (int i = 0; i < metadata.record_size(); ++i) { if (!metadata.record(i).is_on_server()) { @@ -117,7 +55,7 @@ bool MayEntryCommit(ModelTypeSet requested_types, ModelTypeSet encrypted_types, bool passphrase_missing, - const syncable::Entry& entry) { + const Entry& entry) { DCHECK(entry.GetIsUnsynced()); const ModelType type = entry.GetModelType(); @@ -141,7 +79,7 @@ if (entry.GetIsDel() && !entry.GetId().ServerKnows()) { // New clients (following the resolution of crbug.com/125381) should not - // create such items. Old clients may have left some in the database + // create such items. Old clients may have left some in the database // (crbug.com/132905), but we should now be cleaning them on startup. NOTREACHED() << "Found deleted and unsynced local item: " << entry; return false; @@ -163,7 +101,7 @@ if (HasAttachmentNotOnServer(entry)) { // This entry is not ready to be sent to the server because it has one or - // more attachments that have not yet been uploaded to the server. The idea + // more attachments that have not yet been uploaded to the server. The idea // here is avoid propagating an entry with dangling attachment references. return false; } @@ -172,52 +110,20 @@ return true; } -bool SupportsHierarchy(const syncable::Entry& item) { +bool SupportsHierarchy(const Entry& item) { // Types with explicit server supported hierarchy only. return IsTypeWithServerGeneratedRoot(item.GetModelType()); } -// Excludes ancestors of deleted conflicted items from -// |ready_unsynced_set|. -void ExcludeDeletedAncestors( - syncable::BaseTransaction* trans, - const std::vector<int64_t>& deleted_conflicted_items, - std::set<int64_t>* ready_unsynced_set) { - for (auto iter = deleted_conflicted_items.begin(); - iter != deleted_conflicted_items.end(); ++iter) { - syncable::Entry item(trans, syncable::GET_BY_HANDLE, *iter); - syncable::Id parent_id = item.GetParentId(); - DCHECK(!parent_id.IsNull()); - - while (!parent_id.IsRoot()) { - syncable::Entry parent(trans, syncable::GET_BY_ID, parent_id); - CHECK(parent.good()) << "Bad user-only parent in item path."; - int64_t handle = parent.GetMetahandle(); - - if (!parent.GetIsDel()) - break; - - auto ready_iter = ready_unsynced_set->find(handle); - if (ready_iter == ready_unsynced_set->end()) - break; - - // Remove this entry from |ready_unsynced_set|. - ready_unsynced_set->erase(ready_iter); - parent_id = parent.GetParentId(); - } - } -} - // Iterates over children of items from |conflicted_items| list that are in -// |ready_unsynced_set|, exludes them from |ready_unsynced_set| and adds them +// |ready_unsynced_set|, excludes them from |ready_unsynced_set| and adds them // to |excluded_items| list. void ExcludeChildren(syncable::BaseTransaction* trans, const std::vector<int64_t>& conflicted_items, std::vector<int64_t>* excluded_items, std::set<int64_t>* ready_unsynced_set) { - for (auto iter = conflicted_items.begin(); iter != conflicted_items.end(); - ++iter) { - syncable::Entry entry(trans, syncable::GET_BY_HANDLE, *iter); + for (const int64_t& handle : conflicted_items) { + Entry entry(trans, syncable::GET_BY_HANDLE, handle); if (!entry.GetIsDir() || entry.GetIsDel()) continue; @@ -225,10 +131,8 @@ std::vector<int64_t> children; entry.GetChildHandles(&children); - for (std::vector<int64_t>::const_iterator child_iter = children.begin(); - child_iter != children.end(); ++child_iter) { + for (const int64_t& child_handle : children) { // Collect all child handles that are in |ready_unsynced_set|. - int64_t child_handle = *child_iter; auto ready_iter = ready_unsynced_set->find(child_handle); if (ready_iter != ready_unsynced_set->end()) { // Remove this entry from |ready_unsynced_set| and add it @@ -240,93 +144,37 @@ } } -// Filters |unsynced_handles| to remove all entries that do not belong to the -// specified |requested_types|, or are not eligible for a commit at this time. -void FilterUnreadyEntries( - syncable::BaseTransaction* trans, - ModelTypeSet requested_types, - ModelTypeSet encrypted_types, - bool passphrase_missing, - const syncable::Directory::Metahandles& unsynced_handles, - std::set<int64_t>* ready_unsynced_set) { - std::vector<int64_t> deleted_conflicted_items; - std::vector<int64_t> conflicted_items; - - // Go over all unsynced handles, filter the ones that might be committed based - // on type / encryption, then based on whether they are in conflict add them - // to either |ready_unsynced_set| or one of the conflicted lists. - for (auto iter = unsynced_handles.begin(); iter != unsynced_handles.end(); - ++iter) { - syncable::Entry entry(trans, syncable::GET_BY_HANDLE, *iter); - // TODO(maniscalco): While we check if entry is ready to be committed, we - // also need to check that all of its ancestors (parents, transitive) are - // ready to be committed. Once attachments can prevent an entry from being - // committable, this method must ensure all ancestors are ready for commit - // (bug 356273). - if (MayEntryCommit(requested_types, encrypted_types, passphrase_missing, - entry)) { - if (IsEntryInConflict(entry)) { - // Conflicting hierarchical entries might prevent their ancestors or - // descendants from being committed. - if (SupportsHierarchy(entry)) { - if (entry.GetIsDel()) { - deleted_conflicted_items.push_back(*iter); - } else if (entry.GetIsDir()) { - // Populate the initial version of |conflicted_items| with folder - // items that are in conflict. - conflicted_items.push_back(*iter); - } - } - } else { - ready_unsynced_set->insert(*iter); - } - } - } - - // If there are any deleted conflicted entries, remove their deleted ancestors - // from |ready_unsynced_set| as well. - ExcludeDeletedAncestors(trans, deleted_conflicted_items, ready_unsynced_set); - - // Starting with conflicted_items containing conflicted folders go down and - // exclude all descendants from |ready_unsynced_set|. - while (!conflicted_items.empty()) { - std::vector<int64_t> new_list; - ExcludeChildren(trans, conflicted_items, &new_list, ready_unsynced_set); - conflicted_items.swap(new_list); - } -} - -// This class helps to implement OrderCommitIds(). Its members track the -// progress of a traversal while its methods extend it. It can return early if +// This class helps to implement OrderCommitIds(). Its members track the +// progress of a traversal while its methods extend it. It can return early if // the traversal reaches the desired size before the full traversal is complete. class Traversal { public: Traversal(syncable::BaseTransaction* trans, int64_t max_entries, - syncable::Directory::Metahandles* out); + Directory::Metahandles* out); ~Traversal(); - // First step of traversal building. Adds non-deleted items in order. + // First step of traversal building. Adds non-deleted items in order. void AddCreatesAndMoves(const std::set<int64_t>& ready_unsynced_set); - // Second step of traverals building. Appends deleted items. + // Second step of traverals building. Appends deleted items. void AddDeletes(const std::set<int64_t>& ready_unsynced_set); private: - // The following functions do not modify the traversal directly. They return + // The following functions do not modify the traversal directly. They return // their results in the |result| vector instead. void AddUncommittedParents(const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - syncable::Directory::Metahandles* result) const; + const Entry& item, + Directory::Metahandles* result) const; bool TryAddItem(const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - syncable::Directory::Metahandles* result) const; + const Entry& item, + Directory::Metahandles* result) const; void AddDeletedParents(const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - const syncable::Directory::Metahandles& traversed, - syncable::Directory::Metahandles* result) const; + const Entry& item, + const Directory::Metahandles& traversed, + Directory::Metahandles* result) const; // Returns true if we've collected enough items. bool IsFull() const; @@ -335,12 +183,12 @@ bool HaveItem(int64_t handle) const; // Adds the specified handles to the traversal. - void AppendManyToTraversal(const syncable::Directory::Metahandles& handles); + void AppendManyToTraversal(const Directory::Metahandles& handles); - // Adds the specifed handle to the traversal. + // Adds the specified handle to the traversal. void AppendToTraversal(int64_t handle); - syncable::Directory::Metahandles* out_; + Directory::Metahandles* out_; std::set<int64_t> added_handles_; const size_t max_entries_; syncable::BaseTransaction* trans_; @@ -350,22 +198,22 @@ Traversal::Traversal(syncable::BaseTransaction* trans, int64_t max_entries, - syncable::Directory::Metahandles* out) + Directory::Metahandles* out) : out_(out), max_entries_(max_entries), trans_(trans) {} Traversal::~Traversal() {} void Traversal::AddUncommittedParents( const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - syncable::Directory::Metahandles* result) const { + const Entry& item, + Directory::Metahandles* result) const { DCHECK(SupportsHierarchy(item)); - syncable::Directory::Metahandles dependencies; + Directory::Metahandles dependencies; syncable::Id parent_id = item.GetParentId(); // Climb the tree adding entries leaf -> root. while (!parent_id.ServerKnows()) { - syncable::Entry parent(trans_, syncable::GET_BY_ID, parent_id); + Entry parent(trans_, syncable::GET_BY_ID, parent_id); CHECK(parent.good()) << "Bad user-only parent in item path."; int64_t handle = parent.GetMetahandle(); if (HaveItem(handle)) { @@ -388,8 +236,8 @@ // Adds the given item to the list if it is unsynced and ready for commit. bool Traversal::TryAddItem(const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - syncable::Directory::Metahandles* result) const { + const Entry& item, + Directory::Metahandles* result) const { DCHECK(item.GetIsUnsynced()); int64_t item_handle = item.GetMetahandle(); if (ready_unsynced_set.count(item_handle) != 0) { @@ -400,27 +248,26 @@ } // Traverses the tree from bottom to top, adding the deleted parents of the -// given |item|. Stops traversing if it encounters a non-deleted node, or +// given |item|. Stops traversing if it encounters a non-deleted node, or // a node that was already listed in the |traversed| list. // // The result list is reversed before it is returned, so the resulting -// traversal is in top to bottom order. Also note that this function appends +// traversal is in top to bottom order. Also note that this function appends // to the result list without clearing it. -void Traversal::AddDeletedParents( - const std::set<int64_t>& ready_unsynced_set, - const syncable::Entry& item, - const syncable::Directory::Metahandles& traversed, - syncable::Directory::Metahandles* result) const { +void Traversal::AddDeletedParents(const std::set<int64_t>& ready_unsynced_set, + const Entry& item, + const Directory::Metahandles& traversed, + Directory::Metahandles* result) const { DCHECK(SupportsHierarchy(item)); - syncable::Directory::Metahandles dependencies; + Directory::Metahandles dependencies; syncable::Id parent_id = item.GetParentId(); // Climb the tree adding entries leaf -> root. while (!parent_id.IsRoot()) { - syncable::Entry parent(trans_, syncable::GET_BY_ID, parent_id); + Entry parent(trans_, syncable::GET_BY_ID, parent_id); if (!parent.good()) { - // This is valid because the parent could have gone away a long time ago + // This is valid because the parent could have gone away a long time ago. // // Consider the case where a folder is server-unknown and locally // deleted, and has a child that is server-known, deleted, and unsynced. @@ -435,7 +282,7 @@ break; } if (!parent.GetIsDel()) { - // We're not intersted in non-deleted parents. + // We're not interested in non-deleted parents. break; } if (std::find(traversed.begin(), traversed.end(), handle) != @@ -465,95 +312,186 @@ return added_handles_.find(handle) != added_handles_.end(); } -void Traversal::AppendManyToTraversal( - const syncable::Directory::Metahandles& handles) { +void Traversal::AppendManyToTraversal(const Directory::Metahandles& handles) { out_->insert(out_->end(), handles.begin(), handles.end()); added_handles_.insert(handles.begin(), handles.end()); } -void Traversal::AppendToTraversal(int64_t metahandle) { - out_->push_back(metahandle); - added_handles_.insert(metahandle); +void Traversal::AppendToTraversal(int64_t handle) { + out_->push_back(handle); + added_handles_.insert(handle); } void Traversal::AddCreatesAndMoves( const std::set<int64_t>& ready_unsynced_set) { // Add moves and creates, and prepend their uncommitted parents. - for (std::set<int64_t>::const_iterator iter = ready_unsynced_set.begin(); - !IsFull() && iter != ready_unsynced_set.end(); ++iter) { - int64_t metahandle = *iter; - if (HaveItem(metahandle)) + for (const int64_t& handle : ready_unsynced_set) { + if (IsFull()) { + break; + } + if (HaveItem(handle)) continue; - syncable::Entry entry(trans_, syncable::GET_BY_HANDLE, metahandle); + Entry entry(trans_, syncable::GET_BY_HANDLE, handle); if (!entry.GetIsDel()) { if (SupportsHierarchy(entry)) { // We only commit an item + its dependencies if it and all its // dependencies are not in conflict. - syncable::Directory::Metahandles item_dependencies; + Directory::Metahandles item_dependencies; AddUncommittedParents(ready_unsynced_set, entry, &item_dependencies); TryAddItem(ready_unsynced_set, entry, &item_dependencies); AppendManyToTraversal(item_dependencies); } else { // No hierarchy dependencies, just commit the item itself. - AppendToTraversal(metahandle); + AppendToTraversal(handle); } } } - // It's possible that we overcommitted while trying to expand dependent - // items. If so, truncate the set down to the allowed size. + // It's possible that we over committed while trying to expand dependent + // items. If so, truncate the set down to the allowed size. This is safe + // because we've ordered such that ancestors come before children. if (out_->size() > max_entries_) out_->resize(max_entries_); } void Traversal::AddDeletes(const std::set<int64_t>& ready_unsynced_set) { - syncable::Directory::Metahandles deletion_list; + Directory::Metahandles deletion_list; // Note: we iterate over all the unsynced set, regardless of the max size. // The max size is only enforced after the top-to-bottom order has been // reversed, in order to ensure children are always deleted before parents. - for (std::set<int64_t>::const_iterator iter = ready_unsynced_set.begin(); - iter != ready_unsynced_set.end(); ++iter) { - int64_t metahandle = *iter; - - if (HaveItem(metahandle)) + // We cannot bail early when full because we need to guarantee that children + // are always deleted before parents/ancestors. + for (const int64_t& handle : ready_unsynced_set) { + if (HaveItem(handle)) continue; - if (std::find(deletion_list.begin(), deletion_list.end(), metahandle) != + if (std::find(deletion_list.begin(), deletion_list.end(), handle) != deletion_list.end()) { continue; } - syncable::Entry entry(trans_, syncable::GET_BY_HANDLE, metahandle); + Entry entry(trans_, syncable::GET_BY_HANDLE, handle); if (entry.GetIsDel()) { if (SupportsHierarchy(entry)) { - syncable::Directory::Metahandles parents; + Directory::Metahandles parents; AddDeletedParents(ready_unsynced_set, entry, deletion_list, &parents); - // Append parents and chilren in top to bottom order. + // Append parents and children in top to bottom order. deletion_list.insert(deletion_list.end(), parents.begin(), parents.end()); } - deletion_list.push_back(metahandle); + deletion_list.push_back(handle); } } - // We've been gathering deletions in top to bottom order. Now we reverse the + // We've been gathering deletions in top to bottom order. Now we reverse the // order as we prepare the list. std::reverse(deletion_list.begin(), deletion_list.end()); AppendManyToTraversal(deletion_list); - // It's possible that we overcommitted while trying to expand dependent - // items. If so, truncate the set down to the allowed size. + // It's possible that we over committed while trying to expand dependent + // items. If so, truncate the set down to the allowed size. This is safe + // because of the reverse above, which should guarantee the leafy nodes are + // in the front of the ancestors nodes. if (out_->size() > max_entries_) out_->resize(max_entries_); } +// Excludes ancestors of deleted conflicted items from +// |ready_unsynced_set|. +void ExcludeDeletedAncestors( + syncable::BaseTransaction* trans, + const std::vector<int64_t>& deleted_conflicted_items, + std::set<int64_t>* ready_unsynced_set) { + for (const int64_t& deleted_conflicted_handle : deleted_conflicted_items) { + Entry item(trans, syncable::GET_BY_HANDLE, deleted_conflicted_handle); + syncable::Id parent_id = item.GetParentId(); + DCHECK(!parent_id.IsNull()); + + while (!parent_id.IsRoot()) { + Entry parent(trans, syncable::GET_BY_ID, parent_id); + CHECK(parent.good()) << "Bad user-only parent in item path."; + int64_t handle = parent.GetMetahandle(); + + if (!parent.GetIsDel()) + break; + + auto ready_iter = ready_unsynced_set->find(handle); + if (ready_iter == ready_unsynced_set->end()) + break; + + // Remove this entry from |ready_unsynced_set|. + ready_unsynced_set->erase(ready_iter); + parent_id = parent.GetParentId(); + } + } +} + +// Filters |unsynced_handles| to remove all entries that do not belong to the +// specified |requested_types|, or are not eligible for a commit at this time. +void FilterUnreadyEntries(syncable::BaseTransaction* trans, + ModelTypeSet requested_types, + ModelTypeSet encrypted_types, + bool passphrase_missing, + const Directory::Metahandles& unsynced_handles, + std::set<int64_t>* ready_unsynced_set) { + std::vector<int64_t> deleted_conflicted_items; + std::vector<int64_t> conflicted_items; + + // Go over all unsynced handles, filter the ones that might be committed based + // on type / encryption, then based on whether they are in conflict add them + // to either |ready_unsynced_set| or one of the conflicted lists. + for (const int64_t& handle : unsynced_handles) { + Entry entry(trans, syncable::GET_BY_HANDLE, handle); + // TODO(maniscalco): While we check if entry is ready to be committed, we + // also need to check that all of its ancestors (parents, transitive) are + // ready to be committed. Once attachments can prevent an entry from being + // committable, this method must ensure all ancestors are ready for commit + // (crbug.com/356273). + if (MayEntryCommit(requested_types, encrypted_types, passphrase_missing, + entry)) { + if (IsEntryInConflict(entry)) { + // Conflicting hierarchical entries might prevent their ancestors or + // descendants from being committed. + if (SupportsHierarchy(entry)) { + if (entry.GetIsDel()) { + deleted_conflicted_items.push_back(handle); + } else if (entry.GetIsDir()) { + // Populate the initial version of |conflicted_items| with folder + // items that are in conflict. + conflicted_items.push_back(handle); + } + } + } else { + ready_unsynced_set->insert(handle); + } + } + } + + // If there are any deleted conflicted entries, remove their deleted ancestors + // from |ready_unsynced_set| as well. + ExcludeDeletedAncestors(trans, deleted_conflicted_items, ready_unsynced_set); + + // Starting with conflicted_items containing conflicted folders go down and + // exclude all descendants from |ready_unsynced_set|. + while (!conflicted_items.empty()) { + std::vector<int64_t> new_list; + ExcludeChildren(trans, conflicted_items, &new_list, ready_unsynced_set); + conflicted_items.swap(new_list); + } +} + +// Given a set of commit metahandles that are ready for commit +// (|ready_unsynced_set|), sorts these into commit order and places up to +// |max_entries| of them in the output parameter |out|. +// +// See the header file for an explanation of commit ordering. void OrderCommitIds(syncable::BaseTransaction* trans, size_t max_entries, const std::set<int64_t>& ready_unsynced_set, - syncable::Directory::Metahandles* out) { + Directory::Metahandles* out) { // Commits follow these rules: // 1. Moves or creates are preceded by needed folder creates, from // root to leaf. @@ -573,4 +511,39 @@ } // namespace +void GetCommitIdsForType(syncable::BaseTransaction* trans, + ModelType type, + size_t max_entries, + Directory::Metahandles* out) { + Directory* dir = trans->directory(); + + // Gather the full set of unsynced items and store it in the cycle. They + // are not in the correct order for commit. + std::set<int64_t> ready_unsynced_set; + Directory::Metahandles all_unsynced_handles; + GetUnsyncedEntries(trans, &all_unsynced_handles); + + ModelTypeSet encrypted_types; + bool passphrase_missing = false; + Cryptographer* cryptographer = dir->GetCryptographer(trans); + if (cryptographer) { + encrypted_types = dir->GetNigoriHandler()->GetEncryptedTypes(trans); + passphrase_missing = cryptographer->has_pending_keys(); + } + + // We filter out all unready entries from the set of unsynced handles. This + // new set of ready and unsynced items is then what we use to determine what + // is a candidate for commit. The caller is responsible for ensuring that no + // throttled types are included among the requested_types. + FilterUnreadyEntries(trans, ModelTypeSet(type), encrypted_types, + passphrase_missing, all_unsynced_handles, + &ready_unsynced_set); + + OrderCommitIds(trans, max_entries, ready_unsynced_set, out); + + for (const int64_t& handle : *out) { + DVLOG(1) << "Debug commit batch result:" << handle; + } +} + } // namespace syncer
diff --git a/components/sync_bookmarks/bookmark_model_associator.cc b/components/sync_bookmarks/bookmark_model_associator.cc index 8376ee04..c710dbc 100644 --- a/components/sync_bookmarks/bookmark_model_associator.cc +++ b/components/sync_bookmarks/bookmark_model_associator.cc
@@ -777,22 +777,6 @@ return child_node; } -int BookmarkModelAssociator::RemoveSyncNodeHierarchy( - syncer::WriteTransaction* trans, - int64_t sync_id) { - syncer::WriteNode sync_node(trans); - if (sync_node.InitByIdLookup(sync_id) != syncer::BaseNode::INIT_OK) { - syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR, - "Could not lookup bookmark node for ID deletion.", - syncer::BOOKMARKS); - unrecoverable_error_handler_->OnUnrecoverableError(error); - return 0; - } - - return BookmarkChangeProcessor::RemoveSyncNodeHierarchy(trans, &sync_node, - this); -} - struct FolderInfo { FolderInfo(const BookmarkNode* f, const BookmarkNode* p, int64_t id) : folder(f), parent(p), sync_id(id) {}
diff --git a/components/sync_bookmarks/bookmark_model_associator.h b/components/sync_bookmarks/bookmark_model_associator.h index 63561edcf..4bcbfc12 100644 --- a/components/sync_bookmarks/bookmark_model_associator.h +++ b/components/sync_bookmarks/bookmark_model_associator.h
@@ -47,9 +47,7 @@ // * Algorithm to associate bookmark model and sync model. // * Methods to get a bookmark node for a given sync node and vice versa. // * Persisting model associations and loading them back. -class BookmarkModelAssociator - : public syncer::PerDataTypeAssociatorInterface<bookmarks::BookmarkNode, - int64_t> { +class BookmarkModelAssociator : public syncer::AssociatorInterface { public: static syncer::ModelType model_type() { return syncer::BOOKMARKS; } // |expect_mobile_bookmarks_folder| controls whether or not we @@ -85,24 +83,23 @@ // Returns sync id for the given bookmark node id. // Returns syncer::kInvalidId if the sync node is not found for the given // bookmark node id. - int64_t GetSyncIdFromChromeId(const int64_t& node_id) override; + int64_t GetSyncIdFromChromeId(const int64_t& node_id); // Returns the bookmark node for the given sync id. // Returns null if no bookmark node is found for the given sync id. - const bookmarks::BookmarkNode* GetChromeNodeFromSyncId( - int64_t sync_id) override; + const bookmarks::BookmarkNode* GetChromeNodeFromSyncId(int64_t sync_id); // Initializes the given sync node from the given bookmark node id. // Returns false if no sync node was found for the given bookmark node id or // if the initialization of sync node fails. bool InitSyncNodeFromChromeId(const int64_t& node_id, - syncer::BaseNode* sync_node) override; + syncer::BaseNode* sync_node); // Associates the given bookmark node with the given sync node. void Associate(const bookmarks::BookmarkNode* node, - const syncer::BaseNode& sync_node) override; + const syncer::BaseNode& sync_node); // Remove the association that corresponds to the given sync id. - void Disassociate(int64_t sync_id) override; + void Disassociate(int64_t sync_id); void AbortAssociation() override { // No implementation needed, this associator runs on the main @@ -278,10 +275,6 @@ Context* context, syncer::SyncError* error); - // Helper method for deleting a sync node and all its children. - // Returns the number of sync nodes deleted. - int RemoveSyncNodeHierarchy(syncer::WriteTransaction* trans, int64_t sync_id); - // Check whether bookmark model and sync model are synced by comparing // their transaction versions. // Returns a PERSISTENCE_ERROR if a transaction mismatch was detected where
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 56cde403..b2a428de 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -489,8 +489,6 @@ "devtools/forwarding_agent_host.h", "devtools/page_navigation_throttle.cc", "devtools/page_navigation_throttle.h", - "devtools/protocol/color_picker.cc", - "devtools/protocol/color_picker.h", "devtools/protocol/devtools_domain_handler.cc", "devtools/protocol/devtools_domain_handler.h", "devtools/protocol/dom_handler.cc",
diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc index a570f17..4a142c4 100644 --- a/content/browser/appcache/appcache_request_handler_unittest.cc +++ b/content/browser/appcache/appcache_request_handler_unittest.cc
@@ -19,6 +19,7 @@ #include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" +#include "base/strings/stringprintf.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "base/threading/thread_task_runner_handle.h" @@ -30,6 +31,7 @@ #include "net/base/net_errors.h" #include "net/base/request_priority.h" #include "net/http/http_response_headers.h" +#include "net/http/http_util.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_error_job.h" @@ -105,15 +107,8 @@ public: MockURLRequestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate, - int response_code) - : net::URLRequestJob(request, network_delegate), - response_code_(response_code), - has_response_info_(false) {} - MockURLRequestJob(net::URLRequest* request, - net::NetworkDelegate* network_delegate, const net::HttpResponseInfo& info) : net::URLRequestJob(request, network_delegate), - response_code_(info.headers->response_code()), has_response_info_(true), response_info_(info) {} @@ -121,7 +116,6 @@ protected: void Start() override { NotifyHeadersComplete(); } - int GetResponseCode() const override { return response_code_; } void GetResponseInfo(net::HttpResponseInfo* info) override { if (!has_response_info_) return; @@ -129,7 +123,6 @@ } private: - int response_code_; bool has_response_info_; net::HttpResponseInfo response_info_; }; @@ -397,11 +390,16 @@ } void SimulateResponseCode(int response_code) { + net::HttpResponseInfo info; + std::string headers = + base::StringPrintf("HTTP/1.1 %i Muffin\r\n\r\n", response_code); + info.headers = new net::HttpResponseHeaders( + net::HttpUtil::AssembleRawHeaders(headers.c_str(), headers.length())); + job_factory_->SetJob(base::MakeUnique<MockURLRequestJob>( - request_.get(), request_->context()->network_delegate(), - response_code)); + request_.get(), request_->context()->network_delegate(), info)); request_->Start(); - // All our simulation needs to satisfy are the following two DCHECKs + // All our simulation needs to satisfy are the following two DCHECKs. DCHECK_EQ(net::OK, delegate_.request_status()); DCHECK_EQ(response_code, request_->GetResponseCode()); }
diff --git a/content/browser/appcache/appcache_update_job_unittest.cc b/content/browser/appcache/appcache_update_job_unittest.cc index bff0c88..1ba9bbb 100644 --- a/content/browser/appcache/appcache_update_job_unittest.cc +++ b/content/browser/appcache/appcache_update_job_unittest.cc
@@ -16,6 +16,7 @@ #include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" +#include "base/strings/stringprintf.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "base/threading/thread_task_runner_handle.h" @@ -25,6 +26,7 @@ #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/net_errors.h" #include "net/http/http_response_headers.h" +#include "net/http/http_util.h" #include "net/url_request/url_request_error_job.h" #include "net/url_request/url_request_job_factory_impl.h" #include "net/url_request/url_request_test_job.h" @@ -401,18 +403,14 @@ ++num_requests_; if (num_retries_ > 0 && request->original_url() == kRetryUrl) { --num_retries_; - return new RetryRequestTestJob( - request, network_delegate, RetryRequestTestJob::retry_headers(), 503); + return new RetryRequestTestJob(request, network_delegate, + RetryRequestTestJob::retry_headers()); } else { - return new RetryRequestTestJob( - request, - network_delegate, - RetryRequestTestJob::manifest_headers(), 200); + return new RetryRequestTestJob(request, network_delegate, + RetryRequestTestJob::manifest_headers()); } } - int GetResponseCode() const override { return response_code_; } - private: ~RetryRequestTestJob() override {} @@ -455,14 +453,12 @@ RetryRequestTestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate, - const std::string& headers, - int response_code) - : net::URLRequestTestJob( - request, network_delegate, headers, data(), true), - response_code_(response_code) { - } - - int response_code_; + const std::string& headers) + : net::URLRequestTestJob(request, + network_delegate, + headers, + data(), + true) {} static int num_requests_; static int num_retries_;
diff --git a/content/browser/appcache/appcache_url_request_job.cc b/content/browser/appcache/appcache_url_request_job.cc index 00ee1aa2..467f39f 100644 --- a/content/browser/appcache/appcache_url_request_job.cc +++ b/content/browser/appcache/appcache_url_request_job.cc
@@ -417,12 +417,6 @@ *info = *http_info(); } -int AppCacheURLRequestJob::GetResponseCode() const { - if (!http_info()) - return -1; - return http_info()->headers->response_code(); -} - int AppCacheURLRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size) { DCHECK(is_delivering_appcache_response()); DCHECK_NE(buf_size, 0);
diff --git a/content/browser/appcache/appcache_url_request_job.h b/content/browser/appcache/appcache_url_request_job.h index e71e085..3b6de0d 100644 --- a/content/browser/appcache/appcache_url_request_job.h +++ b/content/browser/appcache/appcache_url_request_job.h
@@ -158,7 +158,6 @@ // FilterContext methods bool GetMimeType(std::string* mime_type) const override; - int GetResponseCode() const override; // Invokes |prepare_to_restart_callback_| and then calls // net::URLRequestJob::NotifyRestartRequired.
diff --git a/content/browser/devtools/protocol/color_picker.cc b/content/browser/devtools/protocol/color_picker.cc deleted file mode 100644 index 8897aad..0000000 --- a/content/browser/devtools/protocol/color_picker.cc +++ /dev/null
@@ -1,266 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/browser/devtools/protocol/color_picker.h" - -#include "base/bind.h" -#include "build/build_config.h" -#include "content/browser/renderer_host/render_view_host_impl.h" -#include "content/browser/renderer_host/render_widget_host_view_base.h" -#include "content/common/cursors/webcursor.h" -#include "content/public/common/screen_info.h" -#include "third_party/WebKit/public/platform/WebCursorInfo.h" -#include "third_party/WebKit/public/platform/WebInputEvent.h" -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPath.h" -#include "ui/gfx/geometry/size_conversions.h" - -namespace content { -namespace protocol { - -ColorPicker::ColorPicker(ColorPickedCallback callback) - : callback_(callback), - enabled_(false), - last_cursor_x_(-1), - last_cursor_y_(-1), - host_(nullptr), - weak_factory_(this) { - mouse_event_callback_ = base::Bind( - &ColorPicker::HandleMouseEvent, - base::Unretained(this)); -} - -ColorPicker::~ColorPicker() { -} - -void ColorPicker::SetRenderWidgetHost(RenderWidgetHostImpl* host) { - if (host_ == host) - return; - - if (enabled_ && host_) - host_->RemoveMouseEventCallback(mouse_event_callback_); - ResetFrame(); - host_ = host; - if (enabled_ && host) - host->AddMouseEventCallback(mouse_event_callback_); -} - -void ColorPicker::SetEnabled(bool enabled) { - if (enabled_ == enabled) - return; - - enabled_ = enabled; - if (!host_) - return; - - if (enabled) { - host_->AddMouseEventCallback(mouse_event_callback_); - UpdateFrame(); - } else { - host_->RemoveMouseEventCallback(mouse_event_callback_); - ResetFrame(); - - WebCursor pointer_cursor; - CursorInfo cursor_info; - cursor_info.type = blink::WebCursorInfo::kTypePointer; - pointer_cursor.InitFromCursorInfo(cursor_info); - host_->SetCursor(pointer_cursor); - } -} - -void ColorPicker::OnSwapCompositorFrame() { - if (enabled_) - UpdateFrame(); -} - -void ColorPicker::UpdateFrame() { - if (!host_) - return; - RenderWidgetHostViewBase* view = - static_cast<RenderWidgetHostViewBase*>(host_->GetView()); - if (!view) - return; - - // TODO(miu): This is the wrong size. It's the size of the view on-screen, and - // not the rendering size of the view. The latter is what is wanted here, so - // that the resulting bitmap's pixel coordinates line-up with the - // blink::WebMouseEvent coordinates. http://crbug.com/73362 - gfx::Size should_be_rendering_size = view->GetViewBounds().size(); - view->CopyFromSurface( - gfx::Rect(), should_be_rendering_size, - base::Bind(&ColorPicker::FrameUpdated, weak_factory_.GetWeakPtr()), - kN32_SkColorType); -} - -void ColorPicker::ResetFrame() { - frame_.reset(); - last_cursor_x_ = -1; - last_cursor_y_ = -1; -} - -void ColorPicker::FrameUpdated(const SkBitmap& bitmap, - ReadbackResponse response) { - if (!enabled_) - return; - - if (response == READBACK_SUCCESS) { - frame_ = bitmap; - UpdateCursor(); - } -} - -bool ColorPicker::HandleMouseEvent(const blink::WebMouseEvent& event) { - last_cursor_x_ = event.PositionInWidget().x; - last_cursor_y_ = event.PositionInWidget().y; - if (frame_.drawsNothing()) - return true; - - if (event.button == blink::WebMouseEvent::Button::kLeft && - (event.GetType() == blink::WebInputEvent::kMouseDown || - event.GetType() == blink::WebInputEvent::kMouseMove)) { - if (last_cursor_x_ < 0 || last_cursor_x_ >= frame_.width() || - last_cursor_y_ < 0 || last_cursor_y_ >= frame_.height()) { - return true; - } - - SkAutoLockPixels lock_image(frame_); - SkColor sk_color = frame_.getColor(last_cursor_x_, last_cursor_y_); - callback_.Run(SkColorGetR(sk_color), SkColorGetG(sk_color), - SkColorGetB(sk_color), SkColorGetA(sk_color)); - } - UpdateCursor(); - return true; -} - -void ColorPicker::UpdateCursor() { - if (!host_ || frame_.drawsNothing()) - return; - - if (last_cursor_x_ < 0 || last_cursor_x_ >= frame_.width() || - last_cursor_y_ < 0 || last_cursor_y_ >= frame_.height()) { - return; - } - - RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( - host_->GetView()); - if (!view) - return; - - // Due to platform limitations, we are using two different cursors - // depending on the platform. Mac and Win have large cursors with two circles - // for original spot and its magnified projection; Linux gets smaller (64 px) - // magnified projection only with centered hotspot. - // Mac Retina requires cursor to be > 120px in order to render smoothly. - -#if defined(OS_LINUX) - const float kCursorSize = 63; - const float kDiameter = 63; - const float kHotspotOffset = 32; - const float kHotspotRadius = 0; - const float kPixelSize = 9; -#else - const float kCursorSize = 150; - const float kDiameter = 110; - const float kHotspotOffset = 25; - const float kHotspotRadius = 5; - const float kPixelSize = 10; -#endif - - content::ScreenInfo screen_info; - host_->GetScreenInfo(&screen_info); - double device_scale_factor = screen_info.device_scale_factor; - - SkBitmap result; - result.allocN32Pixels(kCursorSize * device_scale_factor, - kCursorSize * device_scale_factor); - result.eraseARGB(0, 0, 0, 0); - - SkCanvas canvas(result); - canvas.scale(device_scale_factor, device_scale_factor); - canvas.translate(0.5f, 0.5f); - - SkPaint paint; - - // Paint original spot with cross. - if (kHotspotRadius > 0) { - paint.setStrokeWidth(1); - paint.setAntiAlias(false); - paint.setColor(SK_ColorDKGRAY); - paint.setStyle(SkPaint::kStroke_Style); - - canvas.drawLine(kHotspotOffset, kHotspotOffset - 2 * kHotspotRadius, - kHotspotOffset, kHotspotOffset - kHotspotRadius, - paint); - canvas.drawLine(kHotspotOffset, kHotspotOffset + kHotspotRadius, - kHotspotOffset, kHotspotOffset + 2 * kHotspotRadius, - paint); - canvas.drawLine(kHotspotOffset - 2 * kHotspotRadius, kHotspotOffset, - kHotspotOffset - kHotspotRadius, kHotspotOffset, - paint); - canvas.drawLine(kHotspotOffset + kHotspotRadius, kHotspotOffset, - kHotspotOffset + 2 * kHotspotRadius, kHotspotOffset, - paint); - - paint.setStrokeWidth(2); - paint.setAntiAlias(true); - canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint); - } - - // Clip circle for magnified projection. - float padding = (kCursorSize - kDiameter) / 2; - SkPath clip_path; - clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter)); - clip_path.close(); - canvas.clipPath(clip_path, SkClipOp::kIntersect, true); - - // Project pixels. - int pixel_count = kDiameter / kPixelSize; - SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2, - last_cursor_y_ - pixel_count / 2, - pixel_count, pixel_count); - SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter); - canvas.drawBitmapRect(frame_, src_rect, dst_rect, NULL); - - // Paint grid. - paint.setStrokeWidth(1); - paint.setAntiAlias(false); - paint.setColor(SK_ColorGRAY); - for (int i = 0; i < pixel_count; ++i) { - canvas.drawLine(padding + i * kPixelSize, padding, - padding + i * kPixelSize, kCursorSize - padding, paint); - canvas.drawLine(padding, padding + i * kPixelSize, - kCursorSize - padding, padding + i * kPixelSize, paint); - } - - // Paint central pixel in red. - SkRect pixel = SkRect::MakeXYWH((kCursorSize - kPixelSize) / 2, - (kCursorSize - kPixelSize) / 2, - kPixelSize, kPixelSize); - paint.setColor(SK_ColorRED); - paint.setStyle(SkPaint::kStroke_Style); - canvas.drawRect(pixel, paint); - - // Paint outline. - paint.setStrokeWidth(2); - paint.setColor(SK_ColorDKGRAY); - paint.setAntiAlias(true); - canvas.drawCircle(kCursorSize / 2, kCursorSize / 2, kDiameter / 2, paint); - - WebCursor cursor; - CursorInfo cursor_info; - cursor_info.type = blink::WebCursorInfo::kTypeCustom; - cursor_info.image_scale_factor = device_scale_factor; - cursor_info.custom_image = result; - cursor_info.hotspot = - gfx::Point(kHotspotOffset * device_scale_factor, - kHotspotOffset * device_scale_factor); - - cursor.InitFromCursorInfo(cursor_info); - DCHECK(host_); - host_->SetCursor(cursor); -} - -} // namespace protocol -} // namespace content
diff --git a/content/browser/devtools/protocol/color_picker.h b/content/browser/devtools/protocol/color_picker.h deleted file mode 100644 index 3a443f7..0000000 --- a/content/browser/devtools/protocol/color_picker.h +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_ -#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_ - -#include "base/callback.h" -#include "base/macros.h" -#include "content/public/browser/readback_types.h" -#include "content/public/browser/render_widget_host.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace blink { -class WebMouseEvent; -} - -namespace content { - -class RenderWidgetHostImpl; - -namespace protocol { - -class ColorPicker { - public: - typedef base::Callback<void(int, int, int, int)> ColorPickedCallback; - - explicit ColorPicker(ColorPickedCallback callback); - virtual ~ColorPicker(); - - void SetRenderWidgetHost(RenderWidgetHostImpl* host); - void SetEnabled(bool enabled); - void OnSwapCompositorFrame(); - - private: - void UpdateFrame(); - void ResetFrame(); - void FrameUpdated(const SkBitmap&, ReadbackResponse); - bool HandleMouseEvent(const blink::WebMouseEvent& event); - void UpdateCursor(); - - ColorPickedCallback callback_; - bool enabled_; - SkBitmap frame_; - int last_cursor_x_; - int last_cursor_y_; - RenderWidgetHost::MouseEventCallback mouse_event_callback_; - RenderWidgetHostImpl* host_; - base::WeakPtrFactory<ColorPicker> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(ColorPicker); -}; - -} // namespace protocol -} // namespace content - -#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc index 860d28d..def6fe32 100644 --- a/content/browser/devtools/protocol/page_handler.cc +++ b/content/browser/devtools/protocol/page_handler.cc
@@ -22,7 +22,6 @@ #include "base/threading/thread_task_runner_handle.h" #include "content/browser/devtools/devtools_session.h" #include "content/browser/devtools/page_navigation_throttle.h" -#include "content/browser/devtools/protocol/color_picker.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -101,8 +100,6 @@ session_id_(0), frame_counter_(0), frames_in_flight_(0), - color_picker_(new ColorPicker( - base::Bind(&PageHandler::OnColorPicked, base::Unretained(this)))), navigation_throttle_enabled_(false), next_navigation_id_(0), host_(nullptr), @@ -132,7 +129,6 @@ host_ = host; widget_host = host_ ? host_->GetRenderWidgetHost() : nullptr; - color_picker_->SetRenderWidgetHost(widget_host); if (widget_host) { registrar_.Add( @@ -154,7 +150,6 @@ if (screencast_enabled_) InnerSwapCompositorFrame(); - color_picker_->OnSwapCompositorFrame(); } void PageHandler::OnSynchronousSwapCompositorFrame( @@ -171,7 +166,6 @@ if (screencast_enabled_) InnerSwapCompositorFrame(); - color_picker_->OnSwapCompositorFrame(); } void PageHandler::Observe(int type, @@ -207,7 +201,6 @@ enabled_ = false; screencast_enabled_ = false; SetControlNavigations(false); - color_picker_->SetEnabled(false); return Response::FallThrough(); } @@ -377,14 +370,6 @@ return Response::Error("Could not handle JavaScript dialog"); } -Response PageHandler::SetColorPickerEnabled(bool enabled) { - if (!host_) - return Response::InternalError(); - - color_picker_->SetEnabled(enabled); - return Response::OK(); -} - Response PageHandler::RequestAppBanner() { WebContentsImpl* web_contents = GetWebContents(); if (!web_contents) @@ -587,11 +572,6 @@ callback->sendSuccess(EncodeImage(image, format, quality)); } -void PageHandler::OnColorPicked(int r, int g, int b, int a) { - frontend_->ColorPicked( - DOM::RGBA::Create().SetR(r).SetG(g).SetB(b).SetA(a).Build()); -} - Response PageHandler::StopLoading() { WebContentsImpl* web_contents = GetWebContents(); if (!web_contents)
diff --git a/content/browser/devtools/protocol/page_handler.h b/content/browser/devtools/protocol/page_handler.h index 948e255f..faace0a 100644 --- a/content/browser/devtools/protocol/page_handler.h +++ b/content/browser/devtools/protocol/page_handler.h
@@ -38,8 +38,6 @@ namespace protocol { -class ColorPicker; - class PageHandler : public DevToolsDomainHandler, public Page::Backend, public NotificationObserver { @@ -91,7 +89,6 @@ Response HandleJavaScriptDialog(bool accept, Maybe<std::string> prompt_text) override; - Response SetColorPickerEnabled(bool enabled) override; Response RequestAppBanner() override; Response SetControlNavigations(bool enabled) override; @@ -122,8 +119,6 @@ int quality, const gfx::Image& image); - void OnColorPicked(int r, int g, int b, int a); - // NotificationObserver overrides. void Observe(int type, const NotificationSource& source, @@ -145,8 +140,6 @@ int frame_counter_; int frames_in_flight_; - std::unique_ptr<ColorPicker> color_picker_; - bool navigation_throttle_enabled_; int next_navigation_id_; std::map<int, PageNavigationThrottle*> navigation_throttles_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 5437503..6800863 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -556,8 +556,9 @@ // Whether a request to flush input has been issued. bool needs_flush_input_; - // The background color of the web content. - SkColor background_color_; + // The background color of the web content. This color will be drawn when the + // web content is not able to draw in time. + SkColor background_color_ = SK_ColorTRANSPARENT; // Factory used to safely scope delayed calls to ShutdownHost(). base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 896170a..37903da 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -442,7 +442,6 @@ is_guest_view_hack_(is_guest_view_hack), fullscreen_parent_host_view_(nullptr), needs_flush_input_(false), - background_color_(SK_ColorWHITE), weak_factory_(this) { // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| // goes away. Since we autorelease it, our caller must put @@ -450,12 +449,7 @@ cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] initWithRenderWidgetHostViewMac:this] autorelease]; - // Paint this view host with |background_color_| when there is no content - // ready to draw. background_layer_.reset([[CALayer alloc] init]); - // Set the default color to be white. This is the wrong thing to do, but many - // UI components expect this view to be opaque. - [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; [cocoa_view_ setLayer:background_layer_]; [cocoa_view_ setWantsLayer:YES]; @@ -1639,6 +1633,9 @@ } void RenderWidgetHostViewMac::SetBackgroundColor(SkColor color) { + if (color == background_color_) + return; + // The renderer will feed its color back to us with the first CompositorFrame. // We short-cut here to show a sensible color before that happens. UpdateBackgroundColorFromRenderer(color); @@ -1655,7 +1652,7 @@ } void RenderWidgetHostViewMac::UpdateBackgroundColorFromRenderer(SkColor color) { - if (color == background_color()) + if (color == background_color_) return; background_color_ = color; @@ -1767,7 +1764,7 @@ renderWidgetHostView_.reset(r); canBeKeyView_ = YES; - opaque_ = YES; + opaque_ = NO; pinchHasReachedZoomThreshold_ = false; isStylusEnteringProximity_ = false;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index f762d0c8..59ba0e7 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -1271,33 +1271,34 @@ new MockRenderWidgetHostImpl(&delegate, process_host, routing_id); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false); - EXPECT_NE(static_cast<unsigned>(SK_ColorTRANSPARENT), - view->background_color()); - EXPECT_TRUE([view->cocoa_view() isOpaque]); - - view->SetBackgroundColor(SK_ColorTRANSPARENT); EXPECT_EQ(static_cast<unsigned>(SK_ColorTRANSPARENT), view->background_color()); EXPECT_FALSE([view->cocoa_view() isOpaque]); + view->SetBackgroundColor(SK_ColorWHITE); + EXPECT_NE(static_cast<unsigned>(SK_ColorTRANSPARENT), + view->background_color()); + EXPECT_TRUE([view->cocoa_view() isOpaque]); + const IPC::Message* set_background; set_background = process_host->sink().GetUniqueMessageMatching( ViewMsg_SetBackgroundOpaque::ID); ASSERT_TRUE(set_background); std::tuple<bool> sent_background; ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background); - EXPECT_FALSE(std::get<0>(sent_background)); + EXPECT_TRUE(std::get<0>(sent_background)); // Try setting it back. process_host->sink().ClearMessages(); - view->SetBackgroundColor(SK_ColorWHITE); - EXPECT_EQ(static_cast<unsigned>(SK_ColorWHITE), view->background_color()); - EXPECT_TRUE([view->cocoa_view() isOpaque]); + view->SetBackgroundColor(SK_ColorTRANSPARENT); + EXPECT_EQ(static_cast<unsigned>(SK_ColorTRANSPARENT), + view->background_color()); + EXPECT_FALSE([view->cocoa_view() isOpaque]); set_background = process_host->sink().GetUniqueMessageMatching( ViewMsg_SetBackgroundOpaque::ID); ASSERT_TRUE(set_background); ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background); - EXPECT_TRUE(std::get<0>(sent_background)); + EXPECT_FALSE(std::get<0>(sent_background)); host->ShutdownAndDestroyWidget(true); }
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc index d29d85f..5d42160 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc
@@ -68,7 +68,8 @@ return nullptr; } -blink::WebAudioDevice* ContentRendererClient::OverrideCreateAudioDevice() { +blink::WebAudioDevice* ContentRendererClient::OverrideCreateAudioDevice( + const blink::WebAudioLatencyHint& latency_hint) { return nullptr; }
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index d544fb7..4fed0b5 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h
@@ -34,6 +34,7 @@ namespace blink { class WebAudioDevice; +class WebAudioLatencyHint; class WebClipboard; class WebFrame; class WebLocalFrame; @@ -171,7 +172,8 @@ // Allows the embedder to override creating a WebAudioDevice. If it // returns NULL the content layer will create the audio device. - virtual blink::WebAudioDevice* OverrideCreateAudioDevice(); + virtual blink::WebAudioDevice* OverrideCreateAudioDevice( + const blink::WebAudioLatencyHint& latency_hint); // Allows the embedder to override the blink::WebClipboard used. If it // returns NULL the content layer will handle clipboard interactions.
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 7bffa0d..1cf1b53 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -992,7 +992,10 @@ void RenderWidgetCompositor::SetShowDebugBorders(bool show) { cc::LayerTreeDebugState debug_state = layer_tree_host_->GetDebugState(); - debug_state.show_debug_borders = show; + if (show) + debug_state.show_debug_borders.set(); + else + debug_state.show_debug_borders.reset(); layer_tree_host_->SetDebugState(debug_state); }
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc index 553747e..2b3d9b7f 100644 --- a/content/renderer/media/renderer_webaudiodevice_impl.cc +++ b/content/renderer/media/renderer_webaudiodevice_impl.cc
@@ -41,13 +41,43 @@ case WebAudioLatencyHint::kCategoryPlayback: return AudioDeviceFactory::kSourceWebAudioPlayback; case WebAudioLatencyHint::kCategoryExact: - // TODO implement CategoryExact - return AudioDeviceFactory::kSourceWebAudioInteractive; + return AudioDeviceFactory::kSourceWebAudioExact; } NOTREACHED(); return AudioDeviceFactory::kSourceWebAudioInteractive; } +int GetOutputBufferSize(const blink::WebAudioLatencyHint& latency_hint, + media::AudioLatency::LatencyType latency, + const media::AudioParameters& hardware_params) { + // Adjust output buffer size according to the latency requirement. + switch (latency) { + case media::AudioLatency::LATENCY_INTERACTIVE: + return media::AudioLatency::GetInteractiveBufferSize( + hardware_params.frames_per_buffer()); + break; + case media::AudioLatency::LATENCY_RTC: + return media::AudioLatency::GetRtcBufferSize( + hardware_params.sample_rate(), hardware_params.frames_per_buffer()); + break; + case media::AudioLatency::LATENCY_PLAYBACK: + return media::AudioLatency::GetHighLatencyBufferSize( + hardware_params.sample_rate(), 0); + break; + case media::AudioLatency::LATENCY_EXACT_MS: + // TODO(andrew.macpherson@soundtrap.com): http://crbug.com/708917 + return std::min(4096, + media::AudioLatency::GetExactBufferSize( + base::TimeDelta::FromSecondsD(latency_hint.Seconds()), + hardware_params.sample_rate(), + hardware_params.frames_per_buffer())); + break; + default: + NOTREACHED(); + } + return 0; +} + int FrameIdFromCurrentContext() { // Assumption: This method is being invoked within a V8 call stack. CHECKs // will fail in the call to frameForCurrentContext() otherwise. @@ -104,36 +134,16 @@ DCHECK(client_callback_); DCHECK_NE(frame_id_, MSG_ROUTING_NONE); - media::AudioParameters hardware_params(device_params_cb.Run( + const media::AudioParameters hardware_params(device_params_cb.Run( frame_id_, session_id_, std::string(), security_origin_)); - int output_buffer_size = 0; - - media::AudioLatency::LatencyType latency = + const media::AudioLatency::LatencyType latency = AudioDeviceFactory::GetSourceLatencyType( GetLatencyHintSourceType(latency_hint_.Category())); - // Adjust output buffer size according to the latency requirement. - switch (latency) { - case media::AudioLatency::LATENCY_INTERACTIVE: - output_buffer_size = media::AudioLatency::GetInteractiveBufferSize( - hardware_params.frames_per_buffer()); - break; - case media::AudioLatency::LATENCY_RTC: - output_buffer_size = media::AudioLatency::GetRtcBufferSize( - hardware_params.sample_rate(), hardware_params.frames_per_buffer()); - break; - case media::AudioLatency::LATENCY_PLAYBACK: - output_buffer_size = media::AudioLatency::GetHighLatencyBufferSize( - hardware_params.sample_rate(), 0); - break; - case media::AudioLatency::LATENCY_EXACT_MS: - // TODO(olka): add support when WebAudio requires it. - default: - NOTREACHED(); - } - - DCHECK_NE(output_buffer_size, 0); + const int output_buffer_size = + GetOutputBufferSize(latency_hint_, latency, hardware_params); + DCHECK_NE(0, output_buffer_size); sink_params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, layout, hardware_params.sample_rate(), 16, output_buffer_size);
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 4ba0c48..1a8a8f6a 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -693,7 +693,7 @@ const blink::WebSecurityOrigin& security_origin) { // Use a mock for testing. blink::WebAudioDevice* mock_device = - GetContentClient()->renderer()->OverrideCreateAudioDevice(); + GetContentClient()->renderer()->OverrideCreateAudioDevice(latency_hint); if (mock_device) return mock_device;
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc index 89bc02d..af5204e 100644 --- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc +++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -31,7 +31,9 @@ #include "content/shell/test_runner/web_view_test_proxy.h" #include "content/test/mock_webclipboard_impl.h" #include "gin/modules/module_registry.h" +#include "media/base/audio_latency.h" #include "media/media_features.h" +#include "third_party/WebKit/public/platform/WebAudioLatencyHint.h" #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" #include "third_party/WebKit/public/web/WebFrameWidget.h" #include "third_party/WebKit/public/web/WebKit.h" @@ -194,10 +196,38 @@ return interfaces->CreateMIDIAccessor(client); } -WebAudioDevice* LayoutTestContentRendererClient::OverrideCreateAudioDevice() { +WebAudioDevice* LayoutTestContentRendererClient::OverrideCreateAudioDevice( + const blink::WebAudioLatencyHint& latency_hint) { + const double hw_buffer_size = 128; + const double hw_sample_rate = 44100; + double buffer_size = 0; + switch (latency_hint.Category()) { + case blink::WebAudioLatencyHint::kCategoryInteractive: + buffer_size = + media::AudioLatency::GetInteractiveBufferSize(hw_buffer_size); + break; + case blink::WebAudioLatencyHint::kCategoryBalanced: + buffer_size = + media::AudioLatency::GetRtcBufferSize(hw_sample_rate, hw_buffer_size); + break; + case blink::WebAudioLatencyHint::kCategoryPlayback: + buffer_size = + media::AudioLatency::GetHighLatencyBufferSize(hw_sample_rate, 0); + break; + case blink::WebAudioLatencyHint::kCategoryExact: + // TODO(andrew.macpherson@soundtrap.com): http://crbug.com/708917 + buffer_size = std::min( + 4096, media::AudioLatency::GetExactBufferSize( + base::TimeDelta::FromSecondsD(latency_hint.Seconds()), + hw_sample_rate, hw_buffer_size)); + break; + default: + NOTREACHED(); + break; + } test_runner::WebTestInterfaces* interfaces = LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); - return interfaces->CreateAudioDevice(44100, 128); + return interfaces->CreateAudioDevice(hw_sample_rate, buffer_size); } WebClipboard* LayoutTestContentRendererClient::OverrideWebClipboard() {
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.h b/content/shell/renderer/layout_test/layout_test_content_renderer_client.h index e778065..3158505 100644 --- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.h +++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.h
@@ -29,7 +29,8 @@ blink::WebRTCPeerConnectionHandlerClient* client) override; blink::WebMIDIAccessor* OverrideCreateMIDIAccessor( blink::WebMIDIAccessorClient* client) override; - blink::WebAudioDevice* OverrideCreateAudioDevice() override; + blink::WebAudioDevice* OverrideCreateAudioDevice( + const blink::WebAudioLatencyHint& latency_hint) override; blink::WebClipboard* OverrideWebClipboard() override; blink::WebThemeEngine* OverrideThemeEngine() override; std::unique_ptr<MediaStreamRendererFactory> CreateMediaStreamRendererFactory()
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn index 2e40989d..552b8c9 100644 --- a/device/vr/BUILD.gn +++ b/device/vr/BUILD.gn
@@ -89,7 +89,9 @@ deps += [ "//third_party/openvr:openvr" ] sources += [ "openvr/openvr_device.cc", + "openvr/openvr_device.h", "openvr/openvr_device_provider.cc", + "openvr/openvr_device_provider.h", ] } }
diff --git a/ios/chrome/browser/payments/cells/payments_text_item.mm b/ios/chrome/browser/payments/cells/payments_text_item.mm index bc026ad..3c2a6d1 100644 --- a/ios/chrome/browser/payments/cells/payments_text_item.mm +++ b/ios/chrome/browser/payments/cells/payments_text_item.mm
@@ -177,8 +177,12 @@ #pragma mark - NSObject(Accessibility) - (NSString*)accessibilityLabel { - return [NSString stringWithFormat:@"%@, %@", self.textLabel.text, - self.detailTextLabel.text]; + NSString* accessibilityLabel = self.textLabel.text; + if (self.detailTextLabel.text) { + return [NSString stringWithFormat:@"%@, %@", accessibilityLabel, + self.detailTextLabel.text]; + } + return accessibilityLabel; } @end
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm index 2a7d7ff..31dcf99 100644 --- a/ios/chrome/browser/payments/payment_request.mm +++ b/ios/chrome/browser/payments/payment_request.mm
@@ -108,13 +108,10 @@ } void PaymentRequest::PopulateCreditCardCache() { - if (!payments::data_util::ParseBasicCardSupportedNetworks( - web_payment_request_.method_data, &supported_card_networks_, - &basic_card_specified_networks_)) { - // TODO(crbug.com/709036): close the UI and reject the promise since the - // data is invalid. - return; - } + // TODO(crbug.com/709036): Validate method data. + payments::data_util::ParseBasicCardSupportedNetworks( + web_payment_request_.method_data, &supported_card_networks_, + &basic_card_specified_networks_); const std::vector<autofill::CreditCard*>& credit_cards_to_suggest = personal_data_manager_->GetCreditCardsToSuggest();
diff --git a/ios/chrome/browser/web/external_app_launcher.mm b/ios/chrome/browser/web/external_app_launcher.mm index 631e3404..75c01363 100644 --- a/ios/chrome/browser/web/external_app_launcher.mm +++ b/ios/chrome/browser/web/external_app_launcher.mm
@@ -153,10 +153,10 @@ return NO; NSURL* URL = net::NSURLWithGURL(gURL); - // iOS 10.3.2 introduced new prompts when facetime: and facetime-audio: + // iOS 10.3 introduced new prompts when facetime: and facetime-audio: // URL schemes are opened. It is no longer necessary for Chrome to present // another prompt before the system-provided prompt. - if (!base::ios::IsRunningOnOrLater(10, 3, 2) && UrlHasPhoneCallScheme(gURL)) { + if (!base::ios::IsRunningOnOrLater(10, 3, 0) && UrlHasPhoneCallScheme(gURL)) { // Showing an alert view immediately has a side-effect where focus is // taken from the UIWebView so quickly that mouseup events are lost and // buttons get 'stuck' in the on position. The solution is to defer
diff --git a/media/base/audio_latency.cc b/media/base/audio_latency.cc index 5d37edf4..61b3724 100644 --- a/media/base/audio_latency.cc +++ b/media/base/audio_latency.cc
@@ -9,6 +9,7 @@ #include <algorithm> #include "base/logging.h" +#include "base/time/time.h" #include "build/build_config.h" namespace media { @@ -126,4 +127,19 @@ return hardware_buffer_size; } +int AudioLatency::GetExactBufferSize(base::TimeDelta duration, + int sample_rate, + int hardware_buffer_size) { + const double requested_buffer_size = duration.InSecondsF() * sample_rate; + + DCHECK_NE(0, hardware_buffer_size); + + // Round the requested size to the nearest multiple of the hardware size + const int buffer_size = + std::round(std::max(requested_buffer_size, 1.0) / hardware_buffer_size) * + hardware_buffer_size; + + return std::max(buffer_size, hardware_buffer_size); +} + } // namespace media
diff --git a/media/base/audio_latency.h b/media/base/audio_latency.h index c6c44f9c..aae14a78 100644 --- a/media/base/audio_latency.h +++ b/media/base/audio_latency.h
@@ -7,6 +7,10 @@ #include "media/base/media_export.h" +namespace base { +class TimeDelta; +} + namespace media { class MEDIA_EXPORT AudioLatency { @@ -35,6 +39,10 @@ static int GetRtcBufferSize(int sample_rate, int hardware_buffer_size); static int GetInteractiveBufferSize(int hardware_buffer_size); + + static int GetExactBufferSize(base::TimeDelta duration, + int sample_rate, + int hardware_buffer_size); }; } // namespace media
diff --git a/media/base/container_names.cc b/media/base/container_names.cc index 34875b5..afa71ca 100644 --- a/media/base/container_names.cc +++ b/media/base/container_names.cc
@@ -1425,7 +1425,7 @@ static MediaContainerName LookupContainerByFirst4(const uint8_t* buffer, int buffer_size) { // Minimum size that the code expects to exist without checking size. - if (buffer_size < 12) + if (buffer_size < kMinimumContainerSize) return CONTAINER_UNKNOWN; uint32_t first4 = Read32(buffer);
diff --git a/media/base/container_names.h b/media/base/container_names.h index e3885ae..f65b379 100644 --- a/media/base/container_names.h +++ b/media/base/container_names.h
@@ -62,6 +62,9 @@ CONTAINER_MAX // Must be last }; +// Minimum size considered for processing. +enum { kMinimumContainerSize = 12 }; + // Determine the container type. MEDIA_EXPORT MediaContainerName DetermineContainer(const uint8_t* buffer, int buffer_size);
diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc index 77cf670..c1a2145d 100644 --- a/media/filters/ffmpeg_glue.cc +++ b/media/filters/ffmpeg_glue.cc
@@ -137,25 +137,63 @@ // destruction path to avoid double frees. open_called_ = true; - // Attempt to recognize the container by looking at the first few bytes of the - // stream. The stream position is left unchanged. - std::unique_ptr<std::vector<uint8_t>> buffer(new std::vector<uint8_t>(8192)); - - int64_t pos = AVIOSeekOperation(avio_context_.get()->opaque, 0, SEEK_CUR); - AVIOSeekOperation(avio_context_.get()->opaque, 0, SEEK_SET); - int numRead = AVIOReadOperation( - avio_context_.get()->opaque, buffer.get()->data(), buffer.get()->size()); - AVIOSeekOperation(avio_context_.get()->opaque, pos, SEEK_SET); - if (numRead > 0) { - // < 0 means Read failed - container_names::MediaContainerName container = - container_names::DetermineContainer(buffer.get()->data(), numRead); - UMA_HISTOGRAM_SPARSE_SLOWLY("Media.DetectedContainer", container); - } - // By passing nullptr for the filename (second parameter) we are telling // FFmpeg to use the AVIO context we setup from the AVFormatContext structure. - return avformat_open_input(&format_context_, nullptr, nullptr, nullptr) == 0; + const int ret = + avformat_open_input(&format_context_, nullptr, nullptr, nullptr); + + // If FFmpeg can't identify the file, read the first 8k and attempt to guess + // at the container type ourselves. This way we can track emergent formats. + // Only try on AVERROR_INVALIDDATA to avoid running after I/O errors. + if (ret == AVERROR_INVALIDDATA) { + std::vector<uint8_t> buffer(8192); + + const int64_t pos = AVIOSeekOperation(avio_context_->opaque, 0, SEEK_SET); + if (pos < 0) + return false; + + const int num_read = + AVIOReadOperation(avio_context_->opaque, buffer.data(), buffer.size()); + if (num_read < container_names::kMinimumContainerSize) + return false; + + UMA_HISTOGRAM_SPARSE_SLOWLY( + "Media.DetectedContainer", + container_names::DetermineContainer(buffer.data(), num_read)); + return false; + } else if (ret < 0) { + return false; + } + + // Rely on ffmpeg's parsing if we're able to succesfully open the file. + container_names::MediaContainerName container = + container_names::CONTAINER_UNKNOWN; + if (strcmp(format_context_->iformat->name, "mov,mp4,m4a,3gp,3g2,mj2") == 0) + container = container_names::CONTAINER_MOV; + else if (strcmp(format_context_->iformat->name, "flac") == 0) + container = container_names::CONTAINER_FLAC; + else if (strcmp(format_context_->iformat->name, "matroska,webm") == 0) + container = container_names::CONTAINER_WEBM; + else if (strcmp(format_context_->iformat->name, "ogg") == 0) + container = container_names::CONTAINER_OGG; + else if (strcmp(format_context_->iformat->name, "wav") == 0) + container = container_names::CONTAINER_WAV; + else if (strcmp(format_context_->iformat->name, "aac") == 0) + container = container_names::CONTAINER_AAC; + else if (strcmp(format_context_->iformat->name, "mp3") == 0) + container = container_names::CONTAINER_MP3; + else if (strcmp(format_context_->iformat->name, "amr") == 0) + container = container_names::CONTAINER_AMR; + else if (strcmp(format_context_->iformat->name, "avi") == 0) + container = container_names::CONTAINER_AVI; + // TODO(jrummell): Remove GSM detection. http://crbug.com/711774 + else if (strcmp(format_context_->iformat->name, "gsm") == 0) + container = container_names::CONTAINER_GSM; + + DCHECK_NE(container, container_names::CONTAINER_UNKNOWN); + UMA_HISTOGRAM_SPARSE_SLOWLY("Media.DetectedContainer", container); + + return true; } FFmpegGlue::~FFmpegGlue() {
diff --git a/media/filters/ffmpeg_glue_unittest.cc b/media/filters/ffmpeg_glue_unittest.cc index 5781bf3e..cda290e9 100644 --- a/media/filters/ffmpeg_glue_unittest.cc +++ b/media/filters/ffmpeg_glue_unittest.cc
@@ -10,6 +10,8 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/test/histogram_tester.h" +#include "media/base/container_names.h" #include "media/base/mock_filters.h" #include "media/base/test_data_util.h" #include "media/ffmpeg/ffmpeg_common.h" @@ -61,8 +63,8 @@ } int ReadPacket(int size, uint8_t* data) { - return glue_->format_context()->pb->read_packet( - protocol_.get(), data, size); + return glue_->format_context()->pb->read_packet(protocol_.get(), data, + size); } int64_t Seek(int64_t offset, int whence) { @@ -113,6 +115,29 @@ DISALLOW_COPY_AND_ASSIGN(FFmpegGlueDestructionTest); }; +// Tests that ensure we are using the correct AVInputFormat name given by ffmpeg +// for supported containers. +class FFmpegGlueContainerTest : public FFmpegGlueDestructionTest { + public: + FFmpegGlueContainerTest() {} + ~FFmpegGlueContainerTest() override {} + + protected: + void InitializeAndOpen(const char* filename) { + Initialize(filename); + ASSERT_TRUE(glue_->OpenContext()); + } + + void ExpectContainer(container_names::MediaContainerName container) { + histogram_tester_.ExpectUniqueSample("Media.DetectedContainer", container, + 1); + } + + private: + base::HistogramTester histogram_tester_; + DISALLOW_COPY_AND_ASSIGN(FFmpegGlueContainerTest); +}; + // Ensure writing has been disabled. TEST_F(FFmpegGlueTest, Write) { ASSERT_FALSE(glue_->format_context()->pb->write_packet); @@ -253,4 +278,60 @@ avcodec_find_decoder(context->codec_id), nullptr)); } +TEST_F(FFmpegGlueContainerTest, OGG) { + InitializeAndOpen("sfx.ogg"); + ExpectContainer(container_names::CONTAINER_OGG); +} + +TEST_F(FFmpegGlueContainerTest, WEBM) { + InitializeAndOpen("sfx-opus-441.webm"); + ExpectContainer(container_names::CONTAINER_WEBM); +} + +TEST_F(FFmpegGlueContainerTest, FLAC) { + InitializeAndOpen("sfx.flac"); + ExpectContainer(container_names::CONTAINER_FLAC); +} + +TEST_F(FFmpegGlueContainerTest, WAV) { + InitializeAndOpen("sfx_s16le.wav"); + ExpectContainer(container_names::CONTAINER_WAV); +} + +#if BUILDFLAG(USE_PROPRIETARY_CODECS) +TEST_F(FFmpegGlueContainerTest, MOV) { + InitializeAndOpen("sfx.m4a"); + ExpectContainer(container_names::CONTAINER_MOV); +} + +TEST_F(FFmpegGlueContainerTest, MP3) { + InitializeAndOpen("sfx.mp3"); + ExpectContainer(container_names::CONTAINER_MP3); +} + +TEST_F(FFmpegGlueContainerTest, AAC) { + InitializeAndOpen("sfx.adts"); + ExpectContainer(container_names::CONTAINER_AAC); +} + +#if defined(OS_CHROMEOS) +TEST_F(FFmpegGlueContainerTest, AVI) { + InitializeAndOpen("bear.avi"); + ExpectContainer(container_names::CONTAINER_AVI); +} + +TEST_F(FFmpegGlueContainerTest, AMR) { + InitializeAndOpen("bear.amr"); + ExpectContainer(container_names::CONTAINER_AMR); +} +#endif // defined(OS_CHROMEOS) +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) + +// Probe something unsupported to ensure we fall back to the our internal guess. +TEST_F(FFmpegGlueContainerTest, FLV) { + Initialize("bear.flv"); + ASSERT_FALSE(glue_->OpenContext()); + ExpectContainer(container_names::CONTAINER_FLV); +} + } // namespace media
diff --git a/media/test/data/bear.amr b/media/test/data/bear.amr new file mode 100644 index 0000000..0831fdb --- /dev/null +++ b/media/test/data/bear.amr Binary files differ
diff --git a/net/BUILD.gn b/net/BUILD.gn index 58eddf6..c7174e6 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -4719,6 +4719,7 @@ "socket/websocket_transport_client_socket_pool_unittest.cc", "spdy/array_output_buffer.cc", "spdy/array_output_buffer.h", + "spdy/array_output_buffer_test.cc", "spdy/bidirectional_stream_spdy_impl_unittest.cc", "spdy/buffered_spdy_framer_unittest.cc", "spdy/fuzzing/hpack_fuzz_util_test.cc",
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc index 2ba19e6..6eaf02ca 100644 --- a/net/http/http_auth_controller.cc +++ b/net/http/http_auth_controller.cc
@@ -553,4 +553,9 @@ embedded_identity_used_ = true; } +void HttpAuthController::OnConnectionClosed() { + DCHECK(CalledOnValidThread()); + InvalidateCurrentHandler(INVALIDATE_HANDLER); +} + } // namespace net
diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h index 8de4719..f6c2d743 100644 --- a/net/http/http_auth_controller.h +++ b/net/http/http_auth_controller.h
@@ -73,6 +73,12 @@ void DisableAuthScheme(HttpAuth::Scheme scheme); void DisableEmbeddedIdentity(); + // Called when the connection has been closed, so the current handler (which + // contains state bound to the connection) should be dropped. If retrying on a + // new connection, the next call to MaybeGenerateAuthToken will retry the + // current auth scheme. + void OnConnectionClosed(); + private: // Actions for InvalidateCurrentHandler() enum InvalidateHandlerAction {
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 0be676c..eb8dd8e 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -129,7 +129,6 @@ quic_enable_connection_racing(false), quic_enable_non_blocking_io(false), quic_disable_disk_cache(false), - quic_prefer_aes(false), quic_delay_tcp_race(true), quic_max_server_configs_stored_in_properties(0u), quic_clock(nullptr), @@ -200,7 +199,6 @@ params.quic_enable_connection_racing, params.quic_enable_non_blocking_io, params.quic_disable_disk_cache, - params.quic_prefer_aes, params.quic_delay_tcp_race, params.quic_max_server_configs_stored_in_properties, params.quic_close_sessions_on_ip_change, @@ -339,7 +337,6 @@ dict->SetBoolean("enable_connection_racing", params_.quic_enable_connection_racing); dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache); - dict->SetBoolean("prefer_aes", params_.quic_prefer_aes); dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race); dict->SetInteger("max_server_configs_stored_in_properties", params_.quic_max_server_configs_stored_in_properties);
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 1645a3f3..cfcccbe 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -138,8 +138,6 @@ bool quic_enable_non_blocking_io; // Disables using the disk cache to store QUIC server configs. bool quic_disable_disk_cache; - // Prefer AES-GCM to ChaCha20 even if no hardware support is present. - bool quic_prefer_aes; // Delay starting a TCP connection when QUIC believes it can speak // 0-RTT to a server. bool quic_delay_tcp_race;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 226b77ef..2567ac7 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -12294,6 +12294,7 @@ std::vector<std::vector<MockRead>> mock_reads(1); std::vector<std::vector<MockWrite>> mock_writes(1); for (int round = 0; round < test_config.num_auth_rounds; ++round) { + SCOPED_TRACE(round); const TestRound& read_write_round = test_config.rounds[round]; // Set up expected reads and writes. @@ -12334,6 +12335,7 @@ HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); for (int round = 0; round < test_config.num_auth_rounds; ++round) { + SCOPED_TRACE(round); const TestRound& read_write_round = test_config.rounds[round]; // Start or restart the transaction. TestCompletionCallback callback;
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index ed8c8d3..dc864c6 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc
@@ -255,8 +255,9 @@ if (!response_.headers.get()) return ERR_CONNECTION_RESET; - // If the connection can't be reused, just return ERR_CONNECTION_CLOSED. - // The request should be retried at a higher layer. + // If the connection can't be reused, return + // ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH. The request will be retried + // at a higher layer. if (!response_.headers->IsKeepAlive() || !http_stream_parser_->CanFindEndOfResponse() || !transport_->socket()->IsConnected()) {
diff --git a/net/http/http_proxy_client_socket_wrapper.cc b/net/http/http_proxy_client_socket_wrapper.cc index 0d93911..bd664b6c 100644 --- a/net/http/http_proxy_client_socket_wrapper.cc +++ b/net/http/http_proxy_client_socket_wrapper.cc
@@ -60,6 +60,7 @@ user_agent_(user_agent), endpoint_(endpoint), spdy_session_pool_(spdy_session_pool), + has_restarted_(false), tunnel_(tunnel), proxy_delegate_(proxy_delegate), using_spdy_(false), @@ -595,13 +596,33 @@ int HttpProxyClientSocketWrapper::DoRestartWithAuthComplete(int result) { DCHECK_NE(ERR_IO_PENDING, result); + // If the connection could not be reused to attempt to send proxy auth - // credentials, try reconnecting. If auth credentials were sent, pass the - // error on to caller, even if the credentials may have passed a close message - // from the server in flight. - if (result == ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH) { - // If can't reuse the connection, attempt to create a new one. + // credentials, try reconnecting. Do not reset the HttpAuthController in this + // case; the server may, for instance, send "Proxy-Connection: close" and + // expect that each leg of the authentication progress on separate + // connections. + bool reconnect = result == ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH; + + // If auth credentials were sent but the connection was closed, the server may + // have timed out while the user was selecting credentials. Retry once. + if (!has_restarted_ && + (result == ERR_CONNECTION_CLOSED || result == ERR_CONNECTION_RESET || + result == ERR_CONNECTION_ABORTED || + result == ERR_SOCKET_NOT_CONNECTED)) { + reconnect = true; + has_restarted_ = true; + + // Release any auth state bound to the connection. The new connection will + // start the current scheme from scratch. + if (http_auth_controller_) + http_auth_controller_->OnConnectionClosed(); + } + + if (reconnect) { + // Attempt to create a new one. transport_socket_.reset(); + // Reconnect with HIGHEST priority to get in front of other requests that // don't yet have the information |http_auth_controller_| does. // TODO(mmenke): This may still result in waiting in line, if there are
diff --git a/net/http/http_proxy_client_socket_wrapper.h b/net/http/http_proxy_client_socket_wrapper.h index 902b4e7..6953d149 100644 --- a/net/http/http_proxy_client_socket_wrapper.h +++ b/net/http/http_proxy_client_socket_wrapper.h
@@ -181,6 +181,7 @@ const HostPortPair endpoint_; SpdySessionPool* const spdy_session_pool_; + bool has_restarted_; const bool tunnel_; ProxyDelegate* const proxy_delegate_;
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 1c12a9e7..501a1c2 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc
@@ -312,7 +312,8 @@ DCHECK(establishing_tunnel_); next_state_ = STATE_RESTART_TUNNEL_AUTH; stream_.reset(); - return RunLoop(OK); + RunLoop(OK); + return ERR_IO_PENDING; } LoadState HttpStreamFactoryImpl::Job::GetLoadState() const { @@ -559,19 +560,19 @@ RunLoop(result); } -int HttpStreamFactoryImpl::Job::RunLoop(int result) { +void HttpStreamFactoryImpl::Job::RunLoop(int result) { TRACE_EVENT0(kNetTracingCategory, "HttpStreamFactoryImpl::Job::RunLoop"); result = DoLoop(result); if (result == ERR_IO_PENDING) - return result; + return; if (job_type_ == PRECONNECT) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&HttpStreamFactoryImpl::Job::OnPreconnectsComplete, ptr_factory_.GetWeakPtr())); - return ERR_IO_PENDING; + return; } if (IsCertificateError(result)) { @@ -583,15 +584,20 @@ FROM_HERE, base::Bind(&HttpStreamFactoryImpl::Job::OnCertificateErrorCallback, ptr_factory_.GetWeakPtr(), result, ssl_info_)); - return ERR_IO_PENDING; + return; } switch (result) { case ERR_PROXY_AUTH_REQUESTED: { UMA_HISTOGRAM_BOOLEAN("Net.ProxyAuthRequested.HasConnection", connection_.get() != NULL); - if (!connection_.get()) - return ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION; + if (!connection_.get()) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::Bind(&Job::OnStreamFailedCallback, ptr_factory_.GetWeakPtr(), + ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION)); + return; + } CHECK(connection_->socket()); CHECK(establishing_tunnel_); @@ -603,7 +609,7 @@ base::Bind(&Job::OnNeedsProxyAuthCallback, ptr_factory_.GetWeakPtr(), *proxy_socket->GetConnectResponseInfo(), base::RetainedRef(proxy_socket->GetAuthController()))); - return ERR_IO_PENDING; + return; } case ERR_SSL_CLIENT_AUTH_CERT_NEEDED: @@ -613,7 +619,7 @@ &Job::OnNeedsClientAuthCallback, ptr_factory_.GetWeakPtr(), base::RetainedRef( connection_->ssl_error_response_info().cert_request_info))); - return ERR_IO_PENDING; + return; case ERR_HTTPS_PROXY_TUNNEL_RESPONSE: { DCHECK(connection_.get()); @@ -627,7 +633,7 @@ ptr_factory_.GetWeakPtr(), *proxy_socket->GetConnectResponseInfo(), proxy_socket->CreateConnectResponseStream())); - return ERR_IO_PENDING; + return; } case OK: @@ -659,13 +665,13 @@ FROM_HERE, base::Bind(&Job::OnStreamReadyCallback, ptr_factory_.GetWeakPtr())); } - return ERR_IO_PENDING; + return; default: base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&Job::OnStreamFailedCallback, ptr_factory_.GetWeakPtr(), result)); - return ERR_IO_PENDING; + return; } } @@ -732,9 +738,8 @@ int HttpStreamFactoryImpl::Job::StartInternal() { CHECK_EQ(STATE_NONE, next_state_); next_state_ = STATE_START; - int rv = RunLoop(OK); - DCHECK_EQ(ERR_IO_PENDING, rv); - return rv; + RunLoop(OK); + return ERR_IO_PENDING; } int HttpStreamFactoryImpl::Job::DoStart() {
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h index b1c2b66..83c0b0e 100644 --- a/net/http/http_stream_factory_impl_job.h +++ b/net/http/http_stream_factory_impl_job.h
@@ -309,7 +309,9 @@ void OnPreconnectsComplete(); void OnIOComplete(int result); - int RunLoop(int result); + // RunLoop() finishes asynchronously and invokes one of the On* methods (see + // above) when done. + void RunLoop(int result); int DoLoop(int result); int StartInternal(); int DoInitConnectionImpl();
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc index a8a638b..9d24f97 100644 --- a/net/http/http_stream_factory_impl_job_controller.cc +++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -539,10 +539,9 @@ void HttpStreamFactoryImpl::JobController::AddConnectionAttemptsToRequest( Job* job, const ConnectionAttempts& attempts) { - if (is_preconnect_ || (job_bound_ && bound_job_ != job)) + if (is_preconnect_ || IsJobOrphaned(job)) return; - DCHECK(request_); request_->AddConnectionAttempts(attempts); } @@ -622,10 +621,9 @@ void HttpStreamFactoryImpl::JobController::SetSpdySessionKey( Job* job, const SpdySessionKey& spdy_session_key) { - if (is_preconnect_ || (job_bound_ && bound_job_ != job)) + if (is_preconnect_ || IsJobOrphaned(job)) return; - DCHECK(request_); if (!request_->HasSpdySessionKey()) { RequestSet& request_set = factory_->spdy_session_request_map_[spdy_session_key]; @@ -637,9 +635,8 @@ void HttpStreamFactoryImpl::JobController:: RemoveRequestFromSpdySessionRequestMapForJob(Job* job) { - if (is_preconnect_ || (job_bound_ && bound_job_ != job)) + if (is_preconnect_ || IsJobOrphaned(job)) return; - DCHECK(request_); RemoveRequestFromSpdySessionRequestMap(); }
diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc index 91bf749..5715dcb 100644 --- a/net/quic/chromium/quic_stream_factory.cc +++ b/net/quic/chromium/quic_stream_factory.cc
@@ -776,7 +776,6 @@ bool enable_connection_racing, bool enable_non_blocking_io, bool disable_disk_cache, - bool prefer_aes, bool delay_tcp_race, int max_server_configs_stored_in_properties, bool close_sessions_on_ip_change, @@ -823,7 +822,6 @@ enable_connection_racing_(enable_connection_racing), enable_non_blocking_io_(enable_non_blocking_io), disable_disk_cache_(disable_disk_cache), - prefer_aes_(prefer_aes), mark_quic_broken_when_network_blackholes_( mark_quic_broken_when_network_blackholes), delay_tcp_race_(delay_tcp_race), @@ -871,7 +869,7 @@ bool has_aes_hardware_support = !!EVP_has_aes_hardware(); UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.PreferAesGcm", has_aes_hardware_support); - if (has_aes_hardware_support || prefer_aes_) + if (has_aes_hardware_support) crypto_config_.PreferAesGcm(); // When disk cache is used to store the server configs, HttpCache code calls // |set_quic_server_info_factory| if |quic_server_info_factory_| wasn't
diff --git a/net/quic/chromium/quic_stream_factory.h b/net/quic/chromium/quic_stream_factory.h index 3c4fdd0..ab0f7f3 100644 --- a/net/quic/chromium/quic_stream_factory.h +++ b/net/quic/chromium/quic_stream_factory.h
@@ -213,7 +213,6 @@ bool enable_connection_racing, bool enable_non_blocking_io, bool disable_disk_cache, - bool prefer_aes, bool delay_tcp_race, int max_server_configs_stored_in_properties, bool close_sessions_on_ip_change, @@ -586,9 +585,6 @@ // Set if we do not want to load server config from the disk cache. bool disable_disk_cache_; - // Set if AES-GCM should be preferred, even if there is no hardware support. - bool prefer_aes_; - // True if QUIC should be marked as broken when a connection blackholes after // the handshake is confirmed. bool mark_quic_broken_when_network_blackholes_;
diff --git a/net/quic/chromium/quic_stream_factory_test.cc b/net/quic/chromium/quic_stream_factory_test.cc index 8006c2f6..e155e57 100644 --- a/net/quic/chromium/quic_stream_factory_test.cc +++ b/net/quic/chromium/quic_stream_factory_test.cc
@@ -248,7 +248,6 @@ enable_connection_racing_(enable_connection_racing), enable_non_blocking_io_(true), disable_disk_cache_(false), - prefer_aes_(false), delay_tcp_race_(true), close_sessions_on_ip_change_(false), idle_connection_timeout_seconds_(kIdleConnectionTimeoutSeconds), @@ -276,8 +275,7 @@ kDefaultMaxPacketSize, string(), SupportedVersions(version_), always_require_handshake_confirmation_, load_server_info_timeout_srtt_multiplier_, enable_connection_racing_, - enable_non_blocking_io_, disable_disk_cache_, prefer_aes_, - delay_tcp_race_, + enable_non_blocking_io_, disable_disk_cache_, delay_tcp_race_, /*max_server_configs_stored_in_properties*/ 0, close_sessions_on_ip_change_, /*mark_quic_broken_when_network_blackholes*/ false, @@ -779,7 +777,6 @@ bool enable_connection_racing_; bool enable_non_blocking_io_; bool disable_disk_cache_; - bool prefer_aes_; bool delay_tcp_race_; bool close_sessions_on_ip_change_; int idle_connection_timeout_seconds_;
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index 947186d..087ec25 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -195,7 +195,7 @@ // If true, enable version 38 which supports new PADDING frame and respects NSTP // connection option. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_version_38, false) +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_version_38, true) // If true, enable QUIC v39. QUIC_FLAG(bool, FLAGS_quic_enable_version_39, false)
diff --git a/net/spdy/array_output_buffer.h b/net/spdy/array_output_buffer.h index f6c805ab..25f495b 100644 --- a/net/spdy/array_output_buffer.h +++ b/net/spdy/array_output_buffer.h
@@ -24,7 +24,12 @@ size_t Size() const { return current_ - begin_; } char* Begin() const { return begin_; } - void Reset() { begin_ = current_; } + + // Resets the buffer to its original state. + void Reset() { + capacity_ += Size(); + current_ = begin_; + } ArrayOutputBuffer(const ArrayOutputBuffer&) = delete; ArrayOutputBuffer& operator=(const ArrayOutputBuffer&) = delete;
diff --git a/net/spdy/array_output_buffer_test.cc b/net/spdy/array_output_buffer_test.cc new file mode 100644 index 0000000..4dedce7f --- /dev/null +++ b/net/spdy/array_output_buffer_test.cc
@@ -0,0 +1,49 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/spdy/array_output_buffer.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace net { +namespace test { + +// This test verifies that ArrayOutputBuffer is initialized properly. +TEST(ArrayOutputBufferTest, InitializedFromArray) { + char array[100]; + ArrayOutputBuffer buffer(array, sizeof(array)); + EXPECT_EQ(sizeof(array), buffer.BytesFree()); + EXPECT_EQ((uint64_t)0, buffer.Size()); + EXPECT_EQ(array, buffer.Begin()); +} + +// This test verifies that Reset() causes an ArrayOutputBuffer's capacity and +// size to be reset to the initial state. +TEST(ArrayOutputBufferTest, WriteAndReset) { + char array[100]; + ArrayOutputBuffer buffer(array, sizeof(array)); + + // Let's write some bytes. + char* dst; + int size; + buffer.Next(&dst, &size); + ASSERT_GT(size, 1); + ASSERT_NE(nullptr, dst); + const int64_t written = size / 2; + memset(dst, 'x', written); + buffer.AdvanceWritePtr(written); + + // The buffer should be partially used. + EXPECT_EQ((uint64_t)size - written, buffer.BytesFree()); + EXPECT_EQ((uint64_t)written, buffer.Size()); + + buffer.Reset(); + + // After a reset, the buffer should regain its full capacity. + EXPECT_EQ(sizeof(array), buffer.BytesFree()); + EXPECT_EQ((uint64_t)0, buffer.Size()); +} + +} // namespace test +} // namespace net
diff --git a/net/spdy/hpack/hpack_decoder3.cc b/net/spdy/hpack/hpack_decoder3.cc index 2e2fc397..71875b9 100644 --- a/net/spdy/hpack/hpack_decoder3.cc +++ b/net/spdy/hpack/hpack_decoder3.cc
@@ -8,6 +8,7 @@ #include "net/http2/decoder/decode_buffer.h" #include "net/http2/decoder/decode_status.h" #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/spdy/spdy_flags.h" namespace net { namespace { @@ -40,7 +41,6 @@ if (!header_block_started_) { // Initialize the decoding process here rather than in // HandleControlFrameHeadersStart because that method is not always called. - total_hpack_bytes_ = 0; header_block_started_ = true; if (!hpack_decoder_.StartDecodingBlock()) { header_block_started_ = false; @@ -58,7 +58,7 @@ << max_decode_buffer_size_bytes_ << " < " << headers_data_length; return false; } - total_hpack_bytes_ += headers_data_length; + listener_adapter_.AddToTotalHpackBytes(headers_data_length); DecodeBuffer db(headers_data, headers_data_length); bool ok = hpack_decoder_.DecodeFragment(&db); DCHECK(!ok || db.Empty()) << "Remaining=" << db.Remaining(); @@ -73,7 +73,7 @@ bool HpackDecoder3::HandleControlFrameHeadersComplete(size_t* compressed_len) { DVLOG(2) << "HpackDecoder3::HandleControlFrameHeadersComplete"; if (compressed_len != nullptr) { - *compressed_len = total_hpack_bytes_; + *compressed_len = listener_adapter_.total_hpack_bytes(); } if (!hpack_decoder_.EndDecodingBlock()) { DVLOG(3) << "EndDecodingBlock returned false"; @@ -125,6 +125,7 @@ void HpackDecoder3::ListenerAdapter::OnHeaderListStart() { DVLOG(2) << "HpackDecoder3::ListenerAdapter::OnHeaderListStart"; + total_hpack_bytes_ = 0; total_uncompressed_bytes_ = 0; decoded_block_.clear(); if (handler_ != nullptr) { @@ -152,7 +153,11 @@ // We don't clear the SpdyHeaderBlock here to allow access to it until the // next HPACK block is decoded. if (handler_ != nullptr) { - handler_->OnHeaderBlockEnd(total_uncompressed_bytes_); + if (FLAGS_chromium_http2_flag_log_compressed_size) { + handler_->OnHeaderBlockEnd(total_uncompressed_bytes_, total_hpack_bytes_); + } else { + handler_->OnHeaderBlockEnd(total_uncompressed_bytes_); + } handler_ = nullptr; } }
diff --git a/net/spdy/hpack/hpack_decoder3.h b/net/spdy/hpack/hpack_decoder3.h index 7517b30..27e3604 100644 --- a/net/spdy/hpack/hpack_decoder3.h +++ b/net/spdy/hpack/hpack_decoder3.h
@@ -85,6 +85,9 @@ size_t insert_count, int64_t insert_time) override; + void AddToTotalHpackBytes(size_t delta) { total_hpack_bytes_ += delta; } + size_t total_hpack_bytes() const { return total_hpack_bytes_; } + private: // If the caller doesn't provide a handler, the header list is stored in // this SpdyHeaderBlock. @@ -93,6 +96,10 @@ // If non-NULL, handles decoded headers. Not owned. SpdyHeadersHandlerInterface* handler_; + // Total bytes that have been received as input (i.e. HPACK encoded) + // in the current HPACK block. + size_t total_hpack_bytes_; + // Total bytes of the name and value strings in the current HPACK block. size_t total_uncompressed_bytes_; @@ -108,10 +115,6 @@ // The actual decoder. Http2HpackDecoder hpack_decoder_; - // Total bytes that have been received as input (i.e. HPACK encoded) - // in the current HPACK block. - size_t total_hpack_bytes_; - // How much encoded data this decoder is willing to buffer. size_t max_decode_buffer_size_bytes_;
diff --git a/net/spdy/hpack/hpack_decoder3_test.cc b/net/spdy/hpack/hpack_decoder3_test.cc index 73279aa..26eaacf 100644 --- a/net/spdy/hpack/hpack_decoder3_test.cc +++ b/net/spdy/hpack/hpack_decoder3_test.cc
@@ -23,6 +23,7 @@ #include "net/spdy/hpack/hpack_huffman_table.h" #include "net/spdy/hpack/hpack_output_stream.h" #include "net/spdy/platform/api/spdy_string.h" +#include "net/spdy/spdy_flags.h" #include "net/spdy/spdy_test_utils.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -85,19 +86,33 @@ namespace { +const bool kNoCheckDecodedSize = false; + // Is HandleControlFrameHeadersStart to be called, and with what value? enum StartChoice { START_WITH_HANDLER, START_WITHOUT_HANDLER, NO_START }; class HpackDecoder3Test - : public ::testing::TestWithParam<std::tuple<StartChoice, bool>> { + : public ::testing::TestWithParam<std::tuple<StartChoice, bool, bool>> { protected: HpackDecoder3Test() : decoder_(), decoder_peer_(&decoder_) {} void SetUp() override { - std::tie(start_choice_, randomly_split_input_buffer_) = GetParam(); + std::tie(start_choice_, randomly_split_input_buffer_, + expect_total_hpack_bytes_) = GetParam(); + if (start_choice_ != START_WITH_HANDLER) { + EXPECT_FALSE(expect_total_hpack_bytes_) << start_choice_; + } + // Set the flag true for when it is expected, and sometimes when it is not + // needed, as a way to test that it doesn't matter which value it has. + if (expect_total_hpack_bytes_ || start_choice_ != NO_START) { + FLAGS_chromium_http2_flag_log_compressed_size = true; + } else { + FLAGS_chromium_http2_flag_log_compressed_size = false; + } } void HandleControlFrameHeadersStart() { + bytes_passed_in_ = 0; switch (start_choice_) { case START_WITH_HANDLER: decoder_.HandleControlFrameHeadersStart(&handler_); @@ -113,14 +128,19 @@ bool HandleControlFrameHeadersData(SpdyStringPiece str) { VLOG(3) << "HandleControlFrameHeadersData:\n" << base::HexEncode(str.data(), str.size()); + bytes_passed_in_ += str.size(); return decoder_.HandleControlFrameHeadersData(str.data(), str.size()); } bool HandleControlFrameHeadersComplete(size_t* size) { - return decoder_.HandleControlFrameHeadersComplete(size); + bool rc = decoder_.HandleControlFrameHeadersComplete(size); + if (size != nullptr) { + EXPECT_EQ(*size, bytes_passed_in_); + } + return rc; } - bool DecodeHeaderBlock(SpdyStringPiece str) { + bool DecodeHeaderBlock(SpdyStringPiece str, bool check_decoded_size = true) { // Don't call this again if HandleControlFrameHeadersData failed previously. EXPECT_FALSE(decode_has_failed_); HandleControlFrameHeadersStart(); @@ -142,9 +162,24 @@ decode_has_failed_ = true; return false; } - if (!HandleControlFrameHeadersComplete(nullptr)) { - decode_has_failed_ = true; - return false; + // Want to get out the number of compressed bytes that were decoded, + // so pass in a pointer if no handler. + size_t total_hpack_bytes = 0; + if (start_choice_ == START_WITH_HANDLER && expect_total_hpack_bytes_) { + if (!HandleControlFrameHeadersComplete(nullptr)) { + decode_has_failed_ = true; + return false; + } + total_hpack_bytes = handler_.compressed_header_bytes_parsed(); + } else { + if (!HandleControlFrameHeadersComplete(&total_hpack_bytes)) { + decode_has_failed_ = true; + return false; + } + } + EXPECT_EQ(total_hpack_bytes, bytes_passed_in_); + if (check_decoded_size && start_choice_ == START_WITH_HANDLER) { + EXPECT_EQ(handler_.header_bytes_parsed(), SizeOfHeaders(decoded_block())); } return true; } @@ -166,6 +201,14 @@ } } + static size_t SizeOfHeaders(const SpdyHeaderBlock& headers) { + size_t size = 0; + for (const auto& kv : headers) { + size += kv.first.size() + kv.second.size(); + } + return size; + } + const SpdyHeaderBlock& DecodeBlockExpectingSuccess(SpdyStringPiece str) { EXPECT_TRUE(DecodeHeaderBlock(str)); return decoded_block(); @@ -197,15 +240,24 @@ TestHeadersHandler handler_; StartChoice start_choice_; bool randomly_split_input_buffer_; + bool expect_total_hpack_bytes_; bool decode_has_failed_ = false; + size_t bytes_passed_in_; }; INSTANTIATE_TEST_CASE_P( - StartChoiceAndRandomlySplitChoice, + NoHandler, HpackDecoder3Test, - ::testing::Combine( - ::testing::Values(START_WITH_HANDLER, START_WITHOUT_HANDLER, NO_START), - ::testing::Bool())); + ::testing::Combine(::testing::Values(START_WITHOUT_HANDLER, NO_START), + ::testing::Bool(), + ::testing::Values(false))); + +INSTANTIATE_TEST_CASE_P( + WithHandler, + HpackDecoder3Test, + ::testing::Combine(::testing::Values(START_WITH_HANDLER), + ::testing::Bool(), + ::testing::Bool())); TEST_P(HpackDecoder3Test, AddHeaderDataWithHandleControlFrameHeadersData) { // The hpack decode buffer size is limited in size. This test verifies that @@ -988,7 +1040,11 @@ // Confirm that entry has been added by re-using it. hbb.AppendIndexedHeader(62); - EXPECT_TRUE(DecodeHeaderBlock(hbb.buffer())); + // Can't have DecodeHeaderBlock do the default check for size of the decoded + // data because SpdyHeaderBlock will join multiple headers with the same + // name into a single entry, thus we won't see repeated occurrences of the + // name, instead seeing separators between values. + EXPECT_TRUE(DecodeHeaderBlock(hbb.buffer(), kNoCheckDecodedSize)); SpdyHeaderBlock expected_header_set; expected_header_set.AppendValueOrAddHeader(name, value1); @@ -1005,6 +1061,12 @@ 2 * value1.size() + 2 * value2.size() + 2 * value3.size() + 5); EXPECT_EQ(expected_header_set, decoded_block()); + + if (start_choice_ == START_WITH_HANDLER) { + EXPECT_EQ(handler_.header_bytes_parsed(), + 6 * name.size() + 2 * value1.size() + 2 * value2.size() + + 2 * value3.size()); + } } } // namespace
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index 1e30cd1..f00705a 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc
@@ -4087,6 +4087,9 @@ TEST_P(SpdyFramerTest, ContinuationFrameFlags) { uint8_t flags = 0; do { + if (use_output_) { + output_.Reset(); + } SCOPED_TRACE(testing::Message() << "Flags " << flags << std::hex << static_cast<int>(flags)); @@ -4105,18 +4108,26 @@ SpdyHeadersIR headers_ir(42); headers_ir.SetHeader("foo", "bar"); - SpdySerializedFrame frame0(SpdyFramerPeer::SerializeHeaders( - &framer, headers_ir, use_output_ ? &output_ : nullptr)); + SpdySerializedFrame frame0; + if (use_output_) { + ASSERT_TRUE(framer.SerializeHeaders(headers_ir, &output_)); + frame0 = SpdySerializedFrame(output_.Begin(), output_.Size(), false); + } else { + frame0 = framer.SerializeHeaders(headers_ir); + } SetFrameFlags(&frame0, 0); SpdyContinuationIR continuation(42); - SpdySerializedFrame frame(framer.SerializeContinuation(continuation)); + SpdySerializedFrame frame1; if (use_output_) { - output_.Reset(); + char* begin = output_.Begin() + output_.Size(); ASSERT_TRUE(framer.SerializeContinuation(continuation, &output_)); - frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); + frame1 = + SpdySerializedFrame(begin, output_.Size() - frame0.size(), false); + } else { + frame1 = framer.SerializeContinuation(continuation); } - SetFrameFlags(&frame, flags); + SetFrameFlags(&frame1, flags); EXPECT_CALL(debug_visitor, OnReceiveCompressedFrame(42, SpdyFrameType::CONTINUATION, _)); @@ -4127,7 +4138,7 @@ } framer.ProcessInput(frame0.data(), frame0.size()); - framer.ProcessInput(frame.data(), frame.size()); + framer.ProcessInput(frame1.data(), frame1.size()); EXPECT_EQ(SpdyFramer::SPDY_READY_FOR_FRAME, framer.state()); EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.spdy_framer_error()) << SpdyFramer::SpdyFramerErrorToString(framer.spdy_framer_error());
diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc index 100d84f0..1a9fb2b 100644 --- a/net/spdy/spdy_test_utils.cc +++ b/net/spdy/spdy_test_utils.cc
@@ -153,12 +153,14 @@ void TestHeadersHandler::OnHeaderBlockEnd(size_t header_bytes_parsed) { header_bytes_parsed_ = header_bytes_parsed; + compressed_header_bytes_parsed_ = 0; } void TestHeadersHandler::OnHeaderBlockEnd( size_t header_bytes_parsed, - size_t /* compressed_header_bytes_parsed */) { + size_t compressed_header_bytes_parsed) { header_bytes_parsed_ = header_bytes_parsed; + compressed_header_bytes_parsed_ = compressed_header_bytes_parsed; } TestServerPushDelegate::TestServerPushDelegate() {}
diff --git a/net/spdy/spdy_test_utils.h b/net/spdy/spdy_test_utils.h index 86d07b7..a5ecd6a 100644 --- a/net/spdy/spdy_test_utils.h +++ b/net/spdy/spdy_test_utils.h
@@ -68,7 +68,7 @@ // reconstructs multiple header values for the same name. class TestHeadersHandler : public SpdyHeadersHandlerInterface { public: - TestHeadersHandler() : header_bytes_parsed_(0) {} + TestHeadersHandler() {} void OnHeaderBlockStart() override; @@ -77,14 +77,18 @@ void OnHeaderBlockEnd(size_t header_bytes_parsed) override; void OnHeaderBlockEnd(size_t header_bytes_parsed, - size_t /* compressed_header_bytes_parsed */) override; + size_t compressed_header_bytes_parsed) override; const SpdyHeaderBlock& decoded_block() const { return block_; } - size_t header_bytes_parsed() { return header_bytes_parsed_; } + size_t header_bytes_parsed() const { return header_bytes_parsed_; } + size_t compressed_header_bytes_parsed() const { + return compressed_header_bytes_parsed_; + } private: SpdyHeaderBlock block_; - size_t header_bytes_parsed_; + size_t header_bytes_parsed_ = 0; + size_t compressed_header_bytes_parsed_ = 0; DISALLOW_COPY_AND_ASSIGN(TestHeadersHandler); };
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index 328b696d..61d7a4a 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc
@@ -189,7 +189,6 @@ enable_quic(false), quic_max_server_configs_stored_in_properties(0), quic_delay_tcp_race(true), - quic_prefer_aes(false), quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), quic_close_sessions_on_ip_change(false), quic_migrate_sessions_on_network_change(false), @@ -435,8 +434,6 @@ http_network_session_params_.quic_migrate_sessions_on_network_change; network_session_params.quic_user_agent_id = http_network_session_params_.quic_user_agent_id; - network_session_params.quic_prefer_aes = - http_network_session_params_.quic_prefer_aes; network_session_params.quic_migrate_sessions_early = http_network_session_params_.quic_migrate_sessions_early; network_session_params.quic_disable_bidirectional_streams =
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h index 7682780..10c6fca 100644 --- a/net/url_request/url_request_context_builder.h +++ b/net/url_request/url_request_context_builder.h
@@ -97,7 +97,6 @@ std::string quic_user_agent_id; int quic_max_server_configs_stored_in_properties; bool quic_delay_tcp_race; - bool quic_prefer_aes; int quic_idle_connection_timeout_seconds; QuicTagVector quic_connection_options; bool quic_close_sessions_on_ip_change; @@ -252,10 +251,6 @@ quic_migrate_sessions_on_network_change; } - void set_quic_prefer_aes(bool quic_prefer_aes) { - http_network_session_params_.quic_prefer_aes = quic_prefer_aes; - } - void set_quic_migrate_sessions_early(bool quic_migrate_sessions_early) { http_network_session_params_.quic_migrate_sessions_early = quic_migrate_sessions_early;
diff --git a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc index c1b62eb..c568de217 100644 --- a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc +++ b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
@@ -12,6 +12,21 @@ #define PNG_INTERNAL #include "third_party/libpng/png.h" +void* limited_malloc(png_structp, png_alloc_size_t size) { + // libpng may allocate large amounts of memory that the fuzzer reports as + // an error. In order to silence these errors, make libpng fail when trying + // to allocate a large amount. + // This number is chosen to match the default png_user_chunk_malloc_max. + if (size > 8000000) + return nullptr; + + return malloc(size); +} + +void default_free(png_structp, png_voidp ptr) { + return free(ptr); +} + #ifndef PNG_FUZZ_PROGRESSIVE // Read sequentially, with png_read_row. @@ -58,6 +73,10 @@ png_set_user_limits(png_ptr, 65535, 65535); #endif + // Not all potential OOM are due to images with large widths and heights. + // Use a custom allocator that fails for large allocations. + png_set_mem_fn(png_ptr, nullptr, limited_malloc, default_free); + png_set_crc_action(png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE); png_infop info_ptr = png_create_info_struct(png_ptr);
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index ea8cae5b9..81177480 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -304,6 +304,7 @@ Bug(none) compositing/layout-width-change.html [ Failure ] Bug(none) compositing/masks/mask-with-added-filters.html [ Failure Crash ] Bug(none) compositing/masks/mask-with-removed-filters.html [ Failure ] +Bug(none) compositing/nested-border-radius-composited-child.html [ Failure ] Bug(none) compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective.html [ Failure ] Bug(none) compositing/overflow/accelerated-scrolling-with-clip-path-text.html [ Failure ] Bug(none) compositing/overflow/accelerated-scrolling-with-clip-path.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 752870e..00870e9a 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -136,6 +136,35 @@ crbug.com/711704 external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Skip ] crbug.com/711704 external/wpt/css/CSS2/floats/floats-wrap-bfc-006.xht [ Skip ] +#### external/wpt/css/CSS2/floats-clear +#### Passed: 166 +#### Skipped: 25 +crbug.com/711709 external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-007.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/float-non-replaced-width-012.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-005.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-007.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-028.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-036.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-108.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-109.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-110.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-126.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-127.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-128.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-129.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-130.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-131.xht [ Skip ] +crbug.com/711709 external/wpt/css/CSS2/floats-clear/floats-137.xht [ Skip ] + # ====== Layout team owned tests to here ====== # ====== LayoutNG-only failures from here ====== @@ -2065,7 +2094,6 @@ crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html [ Timeout ] crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html [ Timeout ] crbug.com/626703 [ Android Mac ] external/wpt/pointerevents/pointerevent_disabled_form_control-manual.html [ Timeout ] -crbug.com/626703 external/wpt/streams/readable-streams/floating-point-total-queue-size.dedicatedworker.html [ Timeout ] crbug.com/626703 external/wpt/streams/readable-streams/floating-point-total-queue-size.sharedworker.html [ Timeout ] crbug.com/626703 external/wpt/streams/writable-streams/floating-point-total-queue-size.dedicatedworker.html [ Timeout ] crbug.com/626703 external/wpt/streams/writable-streams/floating-point-total-queue-size.sharedworker.html [ Timeout ] @@ -2749,6 +2777,10 @@ # Flaky on trybots crbug.com/688486 external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Failure Pass ] +# Flaky when run in parallel +crbug.com/712332 accessibility/aom.html [ Failure Pass ] +crbug.com/712332 accessibility/aom-string-properties.html [ Failure Pass ] + # Sheriff failures 2017-02-21 crbug.com/73609 http/tests/media/video-play-stall.html [ Pass Timeout ] crbug.com/73609 virtual/mojo-loading/http/tests/media/video-play-stall.html [ Pass Timeout ] @@ -2793,3 +2825,5 @@ crbug.com/682753 fast/canvas-experimental [ Skip ] crbug.com/708934 fast/backgrounds/background-image-relative-url-in-iframe.html [ Failure Pass ] + +crbug.com/712264 external/wpt/service-workers/service-worker/fetch-event.https.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/W3CImportExpectations b/third_party/WebKit/LayoutTests/W3CImportExpectations index b13c59f..eb09851 100644 --- a/third_party/WebKit/LayoutTests/W3CImportExpectations +++ b/third_party/WebKit/LayoutTests/W3CImportExpectations
@@ -84,7 +84,7 @@ external/wpt/css/CSS2/csswg-issues [ Skip ] ## Owners: glebl@chromium.org # external/wpt/css/CSS2/floats [ Pass ] -external/wpt/css/CSS2/floats-clear [ Skip ] +# external/wpt/css/CSS2/floats-clear [ Pass ] external/wpt/css/CSS2/fonts [ Skip ] external/wpt/css/CSS2/generate [ Skip ] external/wpt/css/CSS2/generated-content [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.png b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.png new file mode 100644 index 0000000..0581dfe --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.txt b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.txt new file mode 100644 index 0000000..0188b88f --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.txt
@@ -0,0 +1,11 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x56 + LayoutBlockFlow {HTML} at (0,0) size 800x56 + LayoutBlockFlow {BODY} at (8,8) size 784x40 +layer at (8,8) size 784x40 + LayoutFlexibleBox {DIV} at (0,0) size 784x40 +layer at (8,8) size 100x40 + LayoutBlockFlow zI: 1 {DIV} at (0,0) size 100x40 [bgcolor=#ADD8E6] +layer at (108,8) size 100x40 + LayoutBlockFlow zI: 1 {DIV} at (100,0) size 100x40 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child.html b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child.html new file mode 100644 index 0000000..0128d18 --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<head> +<style> + .outer { + overflow:hidden; + border-radius: 1px; + display:flex; + backface-visibility: hidden; + } + #child-overflow { + border-radius: 5px; + overflow:hidden; + background-color: lightblue; + width: 100px; + height: 40px; + z-index:1 + } + #sibling { + background-color: green; + width: 100px; + height: 40px; + z-index:1 + } +</style> +</head> +<div class="outer"> + <div id="child-overflow"></div> + <div id="sibling"></div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 375d292..fbda2c2c 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -33989,6 +33989,18 @@ {} ] ], + "html/semantics/document-metadata/the-link-element/stylesheet-change-href.html": [ + [ + "/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html", + [ + [ + "/html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html", + "==" + ] + ], + {} + ] + ], "html/semantics/document-metadata/the-link-element/stylesheet-empty-href.html": [ [ "/html/semantics/document-metadata/the-link-element/stylesheet-empty-href.html", @@ -34085,6 +34097,18 @@ {} ] ], + "html/semantics/embedded-content/the-img-element/document-adopt-base-url.html": [ + [ + "/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html", + [ + [ + "/html/semantics/embedded-content/the-img-element/document-base-url-ref.html", + "==" + ] + ], + {} + ] + ], "html/semantics/embedded-content/the-img-element/document-base-url.html": [ [ "/html/semantics/embedded-content/the-img-element/document-base-url.html", @@ -53916,6 +53940,11 @@ {} ] ], + "fetch/api/resources/script-with-header.py": [ + [ + {} + ] + ], "fetch/api/resources/status.py": [ [ {} @@ -55481,6 +55510,11 @@ {} ] ], + "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_iframe.html": [ + [ + {} + ] + ], "html/browsers/sandboxing/.gitkeep": [ [ {} @@ -55751,11 +55785,6 @@ {} ] ], - "html/browsers/the-window-object/window-indexed-properties-expected.txt": [ - [ - {} - ] - ], "html/browsers/the-window-object/window-indexed-properties-strict-expected.txt": [ [ {} @@ -62241,11 +62270,21 @@ {} ] ], + "html/semantics/document-metadata/the-link-element/resources/bad.css": [ + [ + {} + ] + ], "html/semantics/document-metadata/the-link-element/resources/empty-href.css": [ [ {} ] ], + "html/semantics/document-metadata/the-link-element/resources/good.css": [ + [ + {} + ] + ], "html/semantics/document-metadata/the-link-element/resources/stylesheet.css": [ [ {} @@ -62256,6 +62295,11 @@ {} ] ], + "html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html": [ + [ + {} + ] + ], "html/semantics/document-metadata/the-link-element/stylesheet-empty-href-ref.html": [ [ {} @@ -65161,11 +65205,6 @@ {} ] ], - "html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt": [ - [ - {} - ] - ], "html/webappapis/scripting/events/contains.json": [ [ {} @@ -82239,6 +82278,12 @@ {} ] ], + "cssom/serialize-variable-reference.html": [ + [ + "/cssom/serialize-variable-reference.html", + {} + ] + ], "cssom/shorthand-serialization.html": [ [ "/cssom/shorthand-serialization.html", @@ -85495,6 +85540,12 @@ {} ] ], + "fetch/api/basic/block-mime-as-script.html": [ + [ + "/fetch/api/basic/block-mime-as-script.html", + {} + ] + ], "fetch/api/basic/conditional-get.html": [ [ "/fetch/api/basic/conditional-get.html", @@ -87615,6 +87666,12 @@ {} ] ], + "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html": [ + [ + "/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html", + {} + ] + ], "html/browsers/sandboxing/sandbox-allow-same-origin.html": [ [ "/html/browsers/sandboxing/sandbox-allow-same-origin.html", @@ -89467,6 +89524,12 @@ {} ] ], + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html": [ + [ + "/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html", + {} + ] + ], "html/infrastructure/terminology/plugins/text-plain.html": [ [ "/html/infrastructure/terminology/plugins/text-plain.html", @@ -90545,6 +90608,12 @@ {} ] ], + "html/semantics/embedded-content/the-img-element/delay-load-event.html": [ + [ + "/html/semantics/embedded-content/the-img-element/delay-load-event.html", + {} + ] + ], "html/semantics/embedded-content/the-img-element/img.complete.html": [ [ "/html/semantics/embedded-content/the-img-element/img.complete.html", @@ -90787,6 +90856,24 @@ {} ] ], + "html/semantics/forms/form-control-infrastructure/form_attribute.html": [ + [ + "/html/semantics/forms/form-control-infrastructure/form_attribute.html", + {} + ] + ], + "html/semantics/forms/form-control-infrastructure/form_owner_and_table.html": [ + [ + "/html/semantics/forms/form-control-infrastructure/form_owner_and_table.html", + {} + ] + ], + "html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html": [ + [ + "/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html", + {} + ] + ], "html/semantics/forms/form-submission-0/form-data-set-usv.html": [ [ "/html/semantics/forms/form-submission-0/form-data-set-usv.html", @@ -92175,6 +92262,18 @@ {} ] ], + "html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html": [ + [ + "/html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html", + {} + ] + ], + "html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html": [ + [ + "/html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html", + {} + ] + ], "html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html": [ [ "/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html", @@ -140052,6 +140151,10 @@ "329fe02cb9e54b1a24a8f9dedcfcf5c0f61c7f24", "testharness" ], + "cssom/serialize-variable-reference.html": [ + "5e83f084efc82184c3052a40bb4a061fd4a1336f", + "testharness" + ], "cssom/shorthand-serialization-expected.txt": [ "343b41f87fc8e418b70a2ba51ca7ce329769e8f9", "support" @@ -140729,7 +140832,7 @@ "support" ], "dom/events/EventListener-invoke-legacy.html": [ - "5c047e994f2bcb971918b42760c70cea7176abcb", + "e56b332acb454ab76964b78588536777946ddff8", "testharness" ], "dom/events/EventListenerOptions-capture.html": [ @@ -143600,6 +143703,10 @@ "ab322023411faca98534f620806b2418a6767e64", "testharness" ], + "fetch/api/basic/block-mime-as-script.html": [ + "1dd503f1537b09f7aa875ea9a636d587b03601e3", + "testharness" + ], "fetch/api/basic/conditional-get.html": [ "77822a239b405b0b5c0259a335bac6cbe26b7fed", "testharness" @@ -144233,7 +144340,7 @@ "support" ], "fetch/api/request/request-error.html": [ - "bfd03777a43be514a0839ab14f5206f486332fdb", + "ff308916884f69b3f4aa8f2017c4d9fe0caf0f00", "testharness" ], "fetch/api/request/request-headers.html": [ @@ -144253,7 +144360,7 @@ "support" ], "fetch/api/request/request-init-001.sub.html": [ - "096424b40f6a21e989a6a5d8684b29ee8cbb963e", + "49bc4349b4e7a85d88cacd54227355aa986535f1", "testharness" ], "fetch/api/request/request-init-002.html": [ @@ -144324,6 +144431,10 @@ "387c35bf1e576f00a10ce5abb4cc92e78da56845", "support" ], + "fetch/api/resources/script-with-header.py": [ + "0c988e869e2e7af06bef67a2eba8211554b38323", + "support" + ], "fetch/api/resources/status.py": [ "d521bae08fa1ee19e7bbf4301157703e567ad5c6", "support" @@ -146640,6 +146751,14 @@ "9839a9c24ce78ec42da8a60d2175df06e19983c1", "testharness" ], + "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html": [ + "1f0408464d8d98341c9537c3e3356cacbcf2f489", + "testharness" + ], + "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_iframe.html": [ + "d33427abcc87693bce1f5610f460aad12cb99759", + "support" + ], "html/browsers/sandboxing/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -147040,10 +147159,6 @@ "d2821f3c4c01cb0dde1ec892d90e7309bbe842a7", "testharness" ], - "html/browsers/the-window-object/window-indexed-properties-expected.txt": [ - "39af0f42c9017ba8252c3ce419c033435be17a50", - "support" - ], "html/browsers/the-window-object/window-indexed-properties-strict-expected.txt": [ "624baff00a9efae0597ae657ed81dfd2403248d4", "support" @@ -153020,6 +153135,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html": [ + "2a3deba2534cad6f5e0aa85cfc3c90debcead20a", + "testharness" + ], "html/infrastructure/terminology/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -154212,10 +154331,18 @@ "285208d6cf3113ec16bedd107c0740b8c7c8a9d8", "testharness" ], + "html/semantics/document-metadata/the-link-element/resources/bad.css": [ + "b968e6422a283acc772561f8950171b3a5e00397", + "support" + ], "html/semantics/document-metadata/the-link-element/resources/empty-href.css": [ "1dcc57d4f3363562322937979cb7828b0c298daa", "support" ], + "html/semantics/document-metadata/the-link-element/resources/good.css": [ + "04a3a89fe805fc930dc3adfa3a4134b950779697", + "support" + ], "html/semantics/document-metadata/the-link-element/resources/stylesheet.css": [ "2829167c82bafef6cfea06071007a231aa4277f6", "support" @@ -154224,6 +154351,14 @@ "e4a66764ea94d51b42d485d75a3305ea2ab79226", "support" ], + "html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html": [ + "cca943d35bd18e99249d50c6d40cc6fe2e328354", + "support" + ], + "html/semantics/document-metadata/the-link-element/stylesheet-change-href.html": [ + "6083446e9ef1b70f044a353ef96b459956afb1ef", + "reftest" + ], "html/semantics/document-metadata/the-link-element/stylesheet-empty-href-ref.html": [ "1ac8e070630e58df8489b779bdd75cb2b38c25ef", "support" @@ -155145,7 +155280,7 @@ "reftest" ], "html/semantics/embedded-content/the-iframe-element/iframe_harness.js": [ - "c5db7a8f3c32f79a4e24d176cb95563a999240e5", + "2f22f494c69854a79af94ccf90215ece7bb4a130", "support" ], "html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm": [ @@ -155256,6 +155391,14 @@ "bdbfbe9a5908c6233bd7b9697a0762bd2e0f6ede", "testharness" ], + "html/semantics/embedded-content/the-img-element/delay-load-event.html": [ + "e4782535af755b29864fd3de67bbdd0de13f19d7", + "testharness" + ], + "html/semantics/embedded-content/the-img-element/document-adopt-base-url.html": [ + "a4b542eb344cca6bdcceceb3aa7006e900f5400f", + "reftest" + ], "html/semantics/embedded-content/the-img-element/document-base-url-ref.html": [ "add78257076d22891334b93c8072d098ace9b6eb", "support" @@ -155620,6 +155763,18 @@ "bfd11561a2e568668b6aaf94bc6da9e42fccdf55", "testharness" ], + "html/semantics/forms/form-control-infrastructure/form_attribute.html": [ + "b19b882091ff523e71397bfcad5dcf505e0a8f88", + "testharness" + ], + "html/semantics/forms/form-control-infrastructure/form_owner_and_table.html": [ + "7172d74bb5572091ee09abf30a4f6892b85aca3a", + "testharness" + ], + "html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html": [ + "3b1dea35bb4af384125904d69bf569109965714f", + "testharness" + ], "html/semantics/forms/form-submission-0/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -157904,6 +158059,14 @@ "93f820588f813b3e340188c88be1532d6e549757", "testharness" ], + "html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html": [ + "c207792ee550d653bc0734f6ef457c7c0e2749d8", + "testharness" + ], + "html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html": [ + "ea922ee6e02e02349ad56d1e8f69d6555d142883", + "testharness" + ], "html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html": [ "ed1c631e5573192fc85f4234d76e5979a32bb44b", "testharness" @@ -158817,11 +158980,11 @@ "testharness" ], "html/syntax/serializing-html-fragments/serializing-expected.txt": [ - "7bb14c17a3ad5721c31f98fcca1a521cc447c36b", + "9e39a2559af9ebd4b82331aed4bdf4fb195d1271", "support" ], "html/syntax/serializing-html-fragments/serializing.html": [ - "dfc037432227ab79b9ce795547fb370594651b9e", + "cd9e3b8412231aa393081a6234efc7476e00c48e", "testharness" ], "html/syntax/serializing-xml-fragments/OWNERS": [ @@ -159052,10 +159215,6 @@ "c8e48064f18b1d1eb13e151b69ee60b8d68f4dab", "testharness" ], - "html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt": [ - "13a1074c8a857731e0c1a18814f2d27413f156b5", - "support" - ], "html/webappapis/scripting/events/compile-event-handler-settings-objects.html": [ "43a17069cb0d3c819d1b55eaa4616af0b0a338b7", "testharness" @@ -173101,7 +173260,7 @@ "testharness" ], "streams/readable-streams/floating-point-total-queue-size.js": [ - "9e6ba92e9b69437c23f04c80fff47c951e509db1", + "905ea4815c8444a70d1fe3a2e1c2c36ff259c285", "support" ], "streams/readable-streams/floating-point-total-queue-size.serviceworker.https-expected.txt": [ @@ -173481,7 +173640,7 @@ "testharness" ], "streams/writable-streams/floating-point-total-queue-size.js": [ - "14d4a8f5559831fb266061e75177339ba0073edb", + "33db80c0ab6a4794e26816d83e6ece39b707ed63", "support" ], "streams/writable-streams/floating-point-total-queue-size.serviceworker.https.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001-ref.xht new file mode 100644 index 0000000..2a4c9f9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001-ref.xht
@@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the orange square is to the left of the blue square and the squares top edges are aligned.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001.xht new file mode 100644 index 0000000..95b2257 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/adjacent-floats-001.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Multiple floated boxes adjacent to each other</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="adjacent-floats-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Floated boxes are allowed to be next to each other." /> + <style type="text/css"> + div div + { + float: left; + height: 1in; + width: 1in; + } + #div1 + { + background-color: orange; + } + #div2 + { + background-color: blue; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the left of the blue square and the squares top edges are aligned.</p> + <div> + <div id="div1"></div> + <div id="div2"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001-ref.xht new file mode 100644 index 0000000..e607591 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: bottom;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is an orange square below a blue square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001.xht new file mode 100644 index 0000000..928cfd3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-001.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'left'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property set to a value of 'left' positions the current element to clear left-floated elements." /> + <style type="text/css"> + #div1 + { + width: 500px; + } + div div + { + height: 1in; + width: 1in; + } + #div2 + { + background: blue; + float: left; + } + #div3 + { + background: orange; + clear: left; + } + </style> + </head> + <body> + <p>Test passes if there is an orange square below a blue square.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002-ref.xht new file mode 100644 index 0000000..2e2b0b6c4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin-bottom: 0px;} + + img + { + left: 404px; + position: relative; + vertical-align: bottom; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is an orange square below a blue square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002.xht new file mode 100644 index 0000000..6c08b7a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-002.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'right'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-002-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property set to a value of 'right' positions the current element to clear right-floated elements." /> + <style type="text/css"> + #div1 + { + width: 500px; + } + div div + { + float: right; + height: 1in; + width: 1in; + } + #div2 + { + background: blue; + } + #div3 + { + background: orange; + clear: right; + } + </style> + </head> + <body> + <p>Test passes if there is an orange square below a blue square.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003-ref.xht new file mode 100644 index 0000000..38b152c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a black box below the blue and orange boxes.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="144" alt="Image download support must be enabled" /></div> + + <div><img src="support/black15x15.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003.xht new file mode 100644 index 0000000..30c73fbd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-003.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'both'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-003-ref.xht" /> + + <meta content="" name="flags" /> + <meta content="The 'clear' property set to a value of 'both' positions the current element to clear both left- and right-floated elements." name="assert" /> + <style type="text/css"> + #div1 + { + width: 2in; + } + div div + { + height: 1in; + width: 1in; + } + #div2 + { + background: blue; + float: left; + } + #div3 + { + float: right; + background: orange; + height: 1.5in; + } + #div4 + { + background: black; + clear: both; + } + </style> + </head> + <body> + <p>Test passes if there is a black box below the blue and orange boxes.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-004.xht new file mode 100644 index 0000000..3a3bc0d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-004.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'none'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property set to a value of 'none' does not perform any clearing of floated elements." /> + <style type="text/css"> + div div + { + height: 100px; + width: 100px; + } + #div2 + { + background: green; + float: left; + } + #div3 + { + background: red; + clear: none; + } + </style> + </head> + <body> + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-005.xht new file mode 100644 index 0000000..e89ee1c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-005.xht
@@ -0,0 +1,43 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'inherit'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/ css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property set to 'inherit', inherits the computed value from the parent element." /> + <style type="text/css"> + #div1 + { + clear: left; + width: 500px; + } + div div + { + height: 1in; + width: 1in; + } + #div2 + { + background: blue; + float: left; + } + #div3 + { + background: orange; + clear: inherit; + } + </style> + </head> + <body> + <p>Test passes if there is an orange square below a blue square.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000-ref.xht new file mode 100644 index 0000000..973d1c6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000-ref.xht
@@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the word PASS appears on a single line.</p> + + <div>PASS</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000.xht new file mode 100644 index 0000000..4caaeaa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-000.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear on floats after floats with display:none blocks between them</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" /> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/clear/002.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#display-prop" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-000-ref.xht" /> + + <meta name="flags" content=""/> + <style type="text/css"> + .float { float: left; margin: 0; } + .clear { clear: left; display: none; background: red; } + </style> + </head> + <body> + <p>Test passes if the word PASS appears on a single line.</p> + <div class="float">PA</div> + <div class="clear">| FAIL |</div> + <div class="float">SS</div> + </body> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001-ref.xht new file mode 100644 index 0000000..785c521 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001-ref.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img + { + left: 328px; + position: absolute; + top: 8px; + } + + p + { + line-height: 1.25; + margin-top: 24px; + width: 320px; + } + ]]></style> + + </head> + + <body> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <p>Test passes if there is a filled blue square to the right of this text.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001.xht new file mode 100644 index 0000000..3f74603 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-001.xht
@@ -0,0 +1,59 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-row-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-row-group'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + #test + { + background: blue; + clear: both; + display: table-row-group; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-002.xht new file mode 100644 index 0000000..798d4f6a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-002.xht
@@ -0,0 +1,60 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-header-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-header-group'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + #test + { + background: blue; + clear: both; + display: table-header-group; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-003.xht new file mode 100644 index 0000000..ae2272e6c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-003.xht
@@ -0,0 +1,60 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-footer-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-footer-group'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + #test + { + background: blue; + display: table-footer-group; + clear: both; + } + + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-004.xht new file mode 100644 index 0000000..ea145d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-004.xht
@@ -0,0 +1,52 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-row'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-row'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + .test + { + background: blue; + display: table-row; + clear: both; + } + + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div class="test"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="test"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-005.xht new file mode 100644 index 0000000..5b60975 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-005.xht
@@ -0,0 +1,62 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-column-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-column-group'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + #test + { + display: table-column-group; + clear: both; + } + + .col + { + display: table-column; + } + + .row + { + display: table-row; + } + .cell + { + background: blue; + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="test"><div class="col"></div><div class="col"></div></div> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-006.xht new file mode 100644 index 0000000..da87b88 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-006.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-column'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-column'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + #test + { + clear: both; + display: table-column; + } + .row + { + display: table-row; + } + .cell + { + background: blue; + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="test"></div> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-007.xht new file mode 100644 index 0000000..68aaf18 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-007.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-cell'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14--> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-cell'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + #cell + { + background: blue; + color: blue; + display: table-cell; + clear: both; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="cell">C</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008-ref.xht new file mode 100644 index 0000000..6a17a530 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin-bottom: 0px;} + + div {height: 10em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the word PASS appears on a single line below.</p> + + <div>PASS</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht new file mode 100644 index 0000000..59a718a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht
@@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear on inline elements</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch" /> + <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/clear/001-demo.html" type="text/html" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-008-ref.xht" /> + + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'inline'." /> + <style type="text/css"> + .float { float: left; height: 10em; } + .clear { clear: left; } + </style> + </head> + <body> + <p>Test passes if the word PASS appears on a single line below.</p> + <div><div class="float">P</div><span class="clear">A</span>SS</div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009-ref.xht new file mode 100644 index 0000000..f8e1401e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 8px;} + + p + { + line-height: 1.25; + margin: 1.5em 0 1em; + width: 320px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled blue square <strong>below this text</strong>.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009.xht new file mode 100644 index 0000000..d8cf938 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-009.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to block</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-009-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property applies to elements with a display of block." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + span + { + background: blue; + color: blue; + display: block; + clear: both; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square <strong>below this text</strong>.</p> + <div> + <span>B</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-010.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-010.xht new file mode 100644 index 0000000..4fffc83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-010.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to list-item</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property applies to elements with a display of list-item." /> + <style type="text/css"> + body + { + margin-left: 2em; + } + p + { + float: left; + } + div + { + background: blue; + color: blue; + display: list-item; + clear: both; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square <strong>below this text</strong> and a marker bullet on its left-hand side.</p> + <div>L</div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht new file mode 100644 index 0000000..fb76e91 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht
@@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to inline-block</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-17 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'inline-block'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + div + { + background: blue; + display: inline-block; + clear: both; + width: 1in; + } + + + span.block-descendant + { + color: blue; + display: block; + height: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div> + <span class="block-descendant">a</span> + <span class="block-descendant">b</span> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-013.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-013.xht new file mode 100644 index 0000000..4d85a70c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-013.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-009-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does apply to elements with a display of 'table'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + #table + { + background: blue; + clear: both; + display: table; + table-layout: fixed; + width: 1in; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square <strong>below this text</strong>.</p> + + <div id="table"> + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-014.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-014.xht new file mode 100644 index 0000000..f99a789 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-014.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'inline-table'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'inline-table'." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + #table + { + background: blue; + clear: both; + display: inline-table; + table-layout: fixed; + width: 1in; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="table"> + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht new file mode 100644 index 0000000..50a75767 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear applied to element with 'display' set to 'table-caption'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2013-01-10 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + + <link rel="match" href="clear-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property does not apply to elements with a display of 'table-caption' because an anonymous table wrapper box will be generated for a misparented table-caption element and such anonymous table wrapper box creates a block formatting context. Clear will not apply to floats outside a block formatting context." /> + <style type="text/css"> + body {margin: 8px;} + + p + { + float: left; + line-height: 1.25; + margin: 1em 0; + width: 320px; + } + + #caption + { + background: blue; + clear: both; + color: blue; + display: table-caption; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square to the right of this text.</p> + + <div id="caption">C</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001-ref.xht new file mode 100644 index 0000000..c6087ea7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001-ref.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + margin: 1em 0em 1.25em; + width: 6.25em; + } + + div + div {margin-bottom: 2.5em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001.xht new file mode 100644 index 0000000..27ede73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-001.xht
@@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clearance calculations - clear box non-collapsing margins with larger margings than clearance</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-clearance-calculation-001-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="When a cleared element has more top margin than the height of the floated element the margin is collpased with previous in-flow children. The element is then placed at the point of the resulting collapsed margin." /> + <!-- C1 = H-M2 --> + <!-- C2 = Max(M1, M2) - M1 - M2 --> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #parent + { + background: url('support/clear-clearance-calculation-001.png'); + min-height: 6em; + } + div div + { + background: green; + height: 1em; + } + #div1 + { + margin-bottom: 1em; + } + #div2 + { + float: left; + margin: 0; + } + #div3 + { + clear: left; + margin-top: 4em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="parent"> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002-ref.xht new file mode 100644 index 0000000..b90c818 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002-ref.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + margin: 1em 0em 5em; + width: 6.25em; + } + + div + div {height: 3.75em} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002.xht new file mode 100644 index 0000000..98acb521 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-002.xht
@@ -0,0 +1,54 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clearance calculations - clear box non-collapsing margins with larger clearance than margins</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-clearance-calculation-002-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="If after margin collapsing the position of the cleared element is above or hypothetically positioned within the layout position of the float. Then the cleared element is positioned directly below the floated element." /> + <!-- C1 = H-M2 --> + <!-- C2 = Max(M1, M2) - M1 - M2 --> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #parent + { + background: url('support/clear-clearance-calculation-002.png'); + min-height: 8em; + } + div div + { + background: green; + height: 1em; + } + #div1 + { + margin-bottom: 4em; + } + #div2 + { + float: left; + height: 2em; + margin: 0; + } + #div3 + { + clear: left; + margin-top: 3em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="parent"> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003-ref.xht new file mode 100644 index 0000000..f2c3f43 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003-ref.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + margin: 1em 0em 1.25em; + width: 6.25em; + } + + div + div {margin-bottom: 3.75em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003.xht new file mode 100644 index 0000000..672a763 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-003.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clearance calculations - clear box collapsing margins</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-clearance-calculation-003-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="When a cleared element has more top margin than the height of the floated element the margin is collpased with previous in-flow children. The element is then placed at the point of the resulting collapsed margin." /> + <!-- C1 = H-MT2 --> + <!-- C2 = Max(M1, MT2, MB2) - M1 - MT2 --> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #parent + { + background: url('support/clear-clearance-calculation-003.png'); + min-height: 7em; + position: relative; + } + #div1 + { + margin-bottom: 1em; + } + #div2 + { + float: left; + margin: 0; + } + #div3 + { + background: red; + clear: left; + margin-bottom: 5em; + margin-top: 4em; + } + #div1, #div2, #div4 + { + background: green; + height: 1em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="parent"> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004-ref.xht new file mode 100644 index 0000000..45d794c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 8px;} + + div + { + background-color: green; + height: 100px; + margin: 108px 0px 1em; + } + + p {margin: 1em 0em;} + ]]></style> + + </head> + + <body> + + <div></div> + +<p>Test passes if there is a wide green rectangle above and <strong>no red</strong>.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004.xht new file mode 100644 index 0000000..fc9fd3bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-004.xht
@@ -0,0 +1,68 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: clear and clearance calculation - margin collapsing</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-clearance-calculation-004-ref.xht" /> + + <meta content="" name="flags" /> + <meta content="With clear: left, the top border edge of the last paragraph must be below the floating paragraph, i.e., 50px lower. That means that the margin-bottom of the first paragraph must not collapse with the margin-top of the last paragraph and clearance must be added such that clearance + margin-top of last paragraph = 50px, i.e., clearance = 50px - margin-top of last paragraph = 50px - 75px = - 25px." name="assert" /> + + <style type="text/css"><![CDATA[ + body {margin: 8px;} + + #overlapped-red + { + background-color: red; + height: 100px; + left: 8px; + position: absolute; + right: 8px; + top: 108px; + z-index: -1; + } + + #firstParg + { + height: 25px; + margin-bottom: 25px; + margin-top: 0px; + } + + #floatingParg + { + float: left; + height: 50px; + margin: 0; + } + + #lastParg + { + background-color: green; + clear: left; + height: 100px; + margin-top: 75px; + } + ]]></style> + + </head> + + <body> + + <div id="overlapped-red"></div> + + <p id="firstParg"></p> + + <p id="floatingParg"></p> + + <p id="lastParg"></p> + + <p>Test passes if there is a wide green rectangle above and <strong>no red</strong>.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005-ref.xht new file mode 100644 index 0000000..f570c0ff --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005-ref.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 8px;} + + div + { + background-color: green; + color: orange; + font: 100px/1 Ahem; + margin: 118px 0px 0px; + } + + p {margin: 1em 0em;} + ]]></style> + + </head> + + <body> + + <div>XX</div> + + <p>Test passes if there is above an orange rectangle and a wide green rectangle side by side, touching each other. The top of the orange rectangle should be flush with the top of the green rectangle. There should be no red.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005.xht new file mode 100644 index 0000000..4005aeb5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-clearance-calculation-005.xht
@@ -0,0 +1,70 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: clear and clearance calculation - margin collapsing</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-clearance-calculation-005-ref.xht" /> + + <meta content="" name="flags" /> + <meta content="With clear: none, the first and last paragraphs' margins collapse and the last paragraph's top border edge should be flush with the top of the floating paragraph." name="assert" /> + + <style type="text/css"><![CDATA[ + body {margin: 8px;} + + #overlapped-red + { + background-color: red; + height: 100px; + left: 8px; + position: absolute; + right: 8px; + top: 118px; + z-index: -1; + } + + #firstParg + { + height: 20px; + margin-bottom: 90px; + margin-top: 0px; + } + + #floatingParg + { + background-color: orange; + float: left; + height: 100px; + margin: 0; + width: 200px; + } + + #lastParg + { + background-color: green; + clear: none; + height: 100px; + margin-top: 75px; + } + ]]></style> + + </head> + + <body> + + <div id="overlapped-red"></div> + + <p id="firstParg"></p> + + <p id="floatingParg"></p> + + <p id="lastParg"></p> + + <p>Test passes if there is above an orange rectangle and a wide green rectangle side by side, touching each other. The top of the orange rectangle should be flush with the top of the green rectangle. There should be no red.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-default-inheritance-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-default-inheritance-001.xht new file mode 100644 index 0000000..5c12e9f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-default-inheritance-001.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear default inheritance</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property is not inherited by default from the parent element." /> + <style type="text/css"> + #div1 + { + clear: left; + } + div div + { + height: 100px; + width: 100px; + } + #div2 + { + background: green; + float: left; + } + #div3 + { + background: red; + } + </style> + </head> + <body> + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001-ref.xht new file mode 100644 index 0000000..04a7b5c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the yellow square is directly to the right of the blue square and the yellow and blue squares are below the orange square.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-yellow.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001.xht new file mode 100644 index 0000000..fa771217 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-001.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Child elements are not impacted by 'clear'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Child elements of the container are not impacted by clear." /> + <style type="text/css"> + div + { + height: 1in; + width: 1in; + } + #div1 + { + background: orange; + } + #div2 + { + background: blue; + clear: both; + width: 2in; + } + #div3 + { + background: yellow; + float: right; + } + </style> + </head> + <body> + <p>Test passes if the yellow square is directly to the right of the blue square and the yellow and blue squares are below the orange square.</p> + <div id="div1"></div> + <div id="div2"> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002-ref.xht new file mode 100644 index 0000000..5b46a059 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 96px; + left: 96px; + position: relative; + width: 96px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002.xht new file mode 100644 index 0000000..ea08587 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-002.xht
@@ -0,0 +1,43 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clearance of floats and top margin affect</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-002-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Clearance is introduced as spacing above the top margin." /> + <style type="text/css"> + div div + { + float: right; + height: 1in; + width: 1in; + } + #div1 + { + height: 2in; + width: 2in; + } + #div2 + { + background: red; + } + #div3 + { + background: green; + clear: right; + margin-top: -1in; + } + </style> + </head> + <body> + <p>Test passes if there is <strong>no red</strong>.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003-ref.xht new file mode 100644 index 0000000..c77332b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 96px; + margin-left: 96px; + margin-top: 96px; + width: 96px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003.xht new file mode 100644 index 0000000..800b4b19 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-003.xht
@@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear floats handled after margin collapsing</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-003-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Clearance is introduced as spacing above the top margin after margin collapsing occurs." /> + <style type="text/css"> + #div1 + { + height: 2in; + width: 2in; + } + #div2 + { + background: red; + } + #div3 + { + margin-top: 1in; + margin-bottom: 1in; + } + #div4 + { + background: green; + clear: right; + margin-top: -1in; + } + #div2, #div4 + { + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is <strong>no red</strong>.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004-ref.xht new file mode 100644 index 0000000..da392c37 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: bottom;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange square is positioned above the blue square and if there is no red.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004.xht new file mode 100644 index 0000000..2fa3b18 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-004.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'left' with earlier left floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-004-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: left' need to clear earlier left floated boxes." /> + <style type="text/css"> + span + { + float: left; + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + } + #span2 + { + background: blue; + clear: left; + } + </style> + </head> + <body> + <p>Test passes if the orange square is positioned above the blue square and if there is no red.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005-ref.xht new file mode 100644 index 0000000..1a81364 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img + { + position: relative; + left: 96px; + vertical-align: bottom; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is directly below the orange square.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005.xht new file mode 100644 index 0000000..a2359372 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-005.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'right' with earlier right floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-005-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: right' need to clear earlier right floated boxes." /> + <style type="text/css"> + div + { + width: 2in; + } + span + { + float: right; + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + } + #span2 + { + background: blue; + clear: right; + } + </style> + </head> + <body> + <p>Test passes if the blue square is directly below the orange square.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006-ref.xht new file mode 100644 index 0000000..a70d0a22 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: bottom;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue box is below the orange boxes.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006.xht new file mode 100644 index 0000000..817a1219 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-006.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'both' with earlier floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-006-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: both' need to clear earlier floated boxes." /> + <style type="text/css"> + div + { + width: 3in; + } + span + { + height: 1in; + width: 1in; + } + #span1, #span2 + { + background-color: orange; + } + #span1 + { + float: right; + } + #span2, #span3 + { + float: left; + } + #span3 + { + background: blue; + clear: both; + } + </style> + </head> + <body> + <p>Test passes if the blue box is below the orange boxes.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + <span id="span3"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-007.xht new file mode 100644 index 0000000..8f39d6f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-007.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'left' with later left floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="adjacent-floats-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: left' do not clear later left floated boxes." /> + <style type="text/css"> + span + { + float: left; + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + clear: left; + } + #span2 + { + background: blue; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the left of the blue square and the squares top edges are aligned.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-008.xht new file mode 100644 index 0000000..6e58a1fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-008.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'right' with later right floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="adjacent-floats-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: right' do not clear later right floated boxes." /> + <style type="text/css"> + div + { + width: 2in; + } + span + { + float: right; + height: 1in; + width: 1in; + } + #span1 + { + background-color: blue; + clear: right; + } + #span2 + { + background: orange; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the left of the blue square and the squares top edges are aligned.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009-ref.xht new file mode 100644 index 0000000..567b62a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009-ref.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: bottom;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is to the right of the orange squares.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009.xht new file mode 100644 index 0000000..2538578eb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-float-009.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear set to 'both' with later floated boxes</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-float-009-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Boxes with 'clear: both' do not clear later floated boxes." /> + <style type="text/css"> + div + { + width: 4in; + } + span + { + height: 1in; + width: 1in; + } + #span1 + { + background-color: blue; + clear: both; + } + #span1, #span2 + { + float: right; + } + #span2, #span3 + { + background: orange; + } + #span3 + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if the blue square is to the right of the orange squares.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + <span id="span3"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-initial-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-initial-001.xht new file mode 100644 index 0000000..8e663474 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-initial-001.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear initial value</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-clear" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'clear' property has a initial value of 'none'." /> + <style type="text/css"> + div div + { + height: 100px; + width: 100px; + } + #div2 + { + background: green; + float: left; + } + #div3 + { + background: red; + } + </style> + </head> + <body> + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001-ref.xht new file mode 100644 index 0000000..02e7115 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001-ref.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + span {background-color: blue;} + + img {vertical-align: top;} + + ]]></style> + + </head> + + <body> + + <p>Test passes if a short blue stripe is to the right of the orange square.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><span>Filler Text</span></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001.xht new file mode 100644 index 0000000..db819b5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clear-inline-001.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clear on inline elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="clear-inline-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Clear cannot be applied to an inline box." /> + <style type="text/css"> + #span1 + { + background-color: orange; + float: left; + height: 1in; + width: 1in; + } + #span2 + { + background: blue; + clear: left; + } + </style> + </head> + <body> + <p>Test passes if a short blue stripe is to the right of the orange square.</p> + <div> + <span id="span1"></span> + <span id="span2">Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006-ref.xht new file mode 100644 index 0000000..b57ca53 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006-ref.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + margin: 1em 0em 5em; + width: 6.25em; + } + + div + div {margin-bottom: 0em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006.xht new file mode 100644 index 0000000..9fcf682 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/clearance-006.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Zero Clearance</title> + <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control"/> + <link rel="match" href="clearance-006-ref.xht" /> + + <meta name="flags" content=""/> + <meta name="assert" content="Zero clearance is not the same as no clearance."/> + <style type="text/css"> + div { + font: 20px/1em Ahem; + width: 5em; + } + .container { + border-top: solid green 1em; + border-bottom: solid red 1em; + height: 4em; + } + .before { + margin-bottom: 2em; + } + .float { + float: left; + height: 2em; + } + .clear { + clear: both; + margin-top: 2em; + height: 1em; + background: green; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div class="container"> + <div class="before"></div> + <div class="float"></div> + <div class="clear"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-001.xht new file mode 100644 index 0000000..519992c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-001.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float set to 'left'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-26 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property set to 'left' correctly aligns the element to the left and text/objects flow around it." /> + <style type="text/css"> + #div1 + { + border: 2px solid orange; + width: 500px; + } + #div2 + { + float: left; + background: blue; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is in the upper left corner of the orange box and the "Filler Text" flows around the blue square.</p> + <div id="div1"> + <div id="div2"></div> + Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-002.xht new file mode 100644 index 0000000..3fe84818 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-002.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float set to 'right'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-26 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property set to 'right' correctly aligns the element to the right and text/objects flow around it." /> + <style type="text/css"> + #div1 + { + border: 2px solid orange; + width: 500px; + } + #div2 + { + float: right; + background: blue; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is in the upper right corner of the orange box and the "Filler Text" flows around the blue square.</p> + <div id="div1"> + <div id="div2"></div> + Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003-ref.xht new file mode 100644 index 0000000..414eeccf --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: orange solid 2px; + width: 500px; + } + + img {vertical-align: bottom;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is in the upper left corner of the orange box and all the "Filler Text" is completely below the blue square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><br />Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003.xht new file mode 100644 index 0000000..9a570e9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-003.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float set to 'none'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-26 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="float-003-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property set to 'none' does not float the element." /> + <style type="text/css"> + #div1 + { + border: 2px solid orange; + width: 500px; + } + #div2 + { + float: right; + float: none; + background: blue; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is in the upper left corner of the orange box and all the "Filler Text" is completely below the blue square.</p> + <div id="div1"> + <div id="div2"></div> + Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-004.xht new file mode 100644 index 0000000..4d33ebc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-004.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float set to 'inherit'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property set to 'inherit' correctly inherits the value from the parent element." /> + <style type="text/css"> + #div1 + { + border: 2px solid orange; + width: 500px; + float: right; + } + #div2 + { + float: inherit; + background: blue; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is in the upper right corner of the orange box and the "Filler Text" flows around the blue square.</p> + <div id="div1"> + <div id="div2"></div> + Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005-ref.xht new file mode 100644 index 0000000..fcd009ed --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: black; + height: 200px; + width: 200px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if a blue square fills the upper left corner of a bigger black square.</p> + + <div><img src="support/swatch-blue.png" width="100" height="100" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005.xht new file mode 100644 index 0000000..a7577b10 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-005.xht
@@ -0,0 +1,43 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: float - non-positioned block box created after a float</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="float-005-ref.xht" /> + + <meta content="ahem" name="flags" /> + <meta content="A non-positioned block box created after a float box should flow vertically as if the float did not exist. The line boxes created next to the float should be shortened to make room for that preceding floated box." name="assert" /> + + <style type="text/css"><![CDATA[ + div#left-floated-square + { + color: blue; + float: left; + font: 100px/1 Ahem; + } + + div#non-positioned-block-square-after + { + background-color: black; + height: 200px; + width: 200px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if a blue square fills the upper left corner of a bigger black square.</p> + + <div id="left-floated-square">X</div> + + <div id="non-positioned-block-square-after"></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006-ref.xht new file mode 100644 index 0000000..5d1ae28 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 10em; + width: 14em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006.xht new file mode 100644 index 0000000..f9aae964 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-006.xht
@@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: floats - zero height empty float</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <!-- Inspired by http://test.csswg.org/suites/css2.1/20100727/html4/floats-107.htm --> + + <link rel="help" title="Section 9.5 Floats" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="float-006-ref.xht" /> + + <meta content="A zero-height (margin-box) empty float without border and without padding will not require the line box to be shortened; in such case, the zero-height (margin-box) empty float will slide in or will fit in at the top of the line box." name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + #rel-pos-containing-block {position: relative;} + + #green-overlapping-abs-pos + { + background-color: green; + border-bottom: green solid 2em; + border-top: green solid 2em; + left: 0em; + padding: 3em; + position: absolute; + width: 8em; + z-index: auto; + } + + #zero-height-first-float + { + float: left; + width: 18em; + /* + or any other width number which would + represent less than the document box width + */ + } + + #red-overlapped-second-float + { + background-color: red; + float: left; + padding: 5em; + width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div id="rel-pos-containing-block"> + <div id="green-overlapping-abs-pos"></div> + <div id="zero-height-first-float"></div> + <div id="red-overlapped-second-float"></div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001.xht new file mode 100644 index 0000000..52e8677 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001.xht
@@ -0,0 +1,60 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-row-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-row-group'." /> + <style type="text/css"> + #test + { + background: blue; + display: table-row-group; + float: right; + } + + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001a.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001a.xht new file mode 100644 index 0000000..cd26d12de --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-001a.xht
@@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Float applied to element with 'display' set to 'table-row-group'</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo" title="9.7 Relationships between 'display', 'position', and 'float' "/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" title="9.5.1 Positioning the float: the 'float' property" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'float' has a value other than 'none' and is applied to an element with a specified 'display' value of 'table-row-group', then the box is floated and its computed 'display' value is set to 'block'." /> + + <style type="text/css"><![CDATA[ + div#table + { + display: table; + table-layout: fixed; + width: 100%; + } + + div#table-row-group + { + background-color: blue; + display: table-row-group; + float: right; + height: 1in; + width: 1in; + } + + div.row {display: table-row;} + + div.cell + { + color: blue; + display: table-cell; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="table-row-group"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-002.xht new file mode 100644 index 0000000..e94d42f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-002.xht
@@ -0,0 +1,59 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-header-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-header-group'." /> + <style type="text/css"> + #test + { + background: blue; + display: table-header-group; + float: right; + } + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-003.xht new file mode 100644 index 0000000..53cafbf1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-003.xht
@@ -0,0 +1,59 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-footer-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-footer-group'." /> + <style type="text/css"> + #test + { + background: blue; + display: table-footer-group; + float: right; + } + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="test"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004.xht new file mode 100644 index 0000000..dcd994c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004.xht
@@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-row'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-row'." /> + <style type="text/css"> + .test + { + background: blue; + display: table-row; + float: right; + } + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + .cell + { + color: blue; + display: table-cell; + height: 1in; + width: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div class="test"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004a.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004a.xht new file mode 100644 index 0000000..2e302fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-004a.xht
@@ -0,0 +1,55 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Float applied to element with 'display' set to 'table-row'</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo" title="9.7 Relationships between 'display', 'position', and 'float' "/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" title="9.5.1 Positioning the float: the 'float' property" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'float' has a value other than 'none' and is applied to an element with a specified 'display' value of 'table-row', then the box is floated and its computed 'display' value is set to 'block'." /> + + <style type="text/css"><![CDATA[ + div#table + { + display: table; + table-layout: fixed; + width: 100%; + } + + div#table-row + { + background-color: blue; + display: table-row; + float: right; + height: 1in; + width: 1in; + } + + div.cell + { + color: blue; + display: table-cell; + } + + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + <div id="table-row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-005.xht new file mode 100644 index 0000000..f2c62fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-005.xht
@@ -0,0 +1,58 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-column-group'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-column-group' in which case the box is floated and its computed 'display' value is set to 'block'." /> + <style type="text/css"> + #test + { + background: blue; + display: table-column-group; + float: right; + height: 1in; + width: 1in; + } + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + + #col + { + display: table-column; + } + + #row + { + display: table-row; + } + #cell + { + display: table-cell; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="test"><div id="col"></div></div> + + <div id="row"> + <div id="cell"></div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-006.xht new file mode 100644 index 0000000..b991a5cf --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-006.xht
@@ -0,0 +1,52 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-column'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-column' in which case the box is floated and its computed 'display' value is set to 'block'." /> + <style type="text/css"> + #test + { + background: blue; + display: table-column; + float: right; + height: 1in; + width: 1in; + } + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + #row + { + display: table-row; + } + #cell + { + display: table-cell; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div id="test"></div> + + <div id="row"> + <div id="cell"></div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-007.xht new file mode 100644 index 0000000..82c3c1ce --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-007.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-cell'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-cell' in which case the box is floated and its computed 'display' value is set to 'block'." /> + <style type="text/css"> + #table + { + display: table; + table-layout: fixed; + width: 100%; + } + #row + { + display: table-row; + } + #cell + { + background: blue; + display: table-cell; + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + <div id="table"> + <div id="row"> + <div id="cell"></div> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008-ref.xht new file mode 100644 index 0000000..1d7dde1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008-ref.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div {text-align: right;} + + span {background-color: blue;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a short blue stripe on the right side of the page.</p> + + <div><span>Filler Text</span></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht new file mode 100644 index 0000000..4c78d57b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to inline</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="float-applies-to-008-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of inline." /> + <style type="text/css"> + div + { + background: blue; + display: inline; + float: right; + } + </style> + </head> + <body> + <p>Test passes if there is a short blue stripe on the right side of the page.</p> + <div>Filler Text</div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008a.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008a.xht new file mode 100644 index 0000000..c27a8b3f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-008a.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Float applied to element with 'display' set to inline</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo" title="9.7 Relationships between 'display', 'position', and 'float' "/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" title="9.5.1 Positioning the float: the 'float' property" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'float' has a value other than 'none' and is applied to an element with a specified 'display' value of 'inline', then the box is floated and its computed 'display' value is set to 'block'." /> + + <style type="text/css"><![CDATA[ + div + { + background-color: blue; + color: blue; + display: inline; + float: right; + height: 1in; + width: 1in; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div>a</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-009.xht new file mode 100644 index 0000000..b400a2c15 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-009.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to block</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of block." /> + <style type="text/css"> + span + { + background: blue; + display: block; + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + <div> + <span></span> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-010.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-010.xht new file mode 100644 index 0000000..ce893ed9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-010.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to list-item</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of list-item." /> + <style type="text/css"> + div + { + background: blue; + display: list-item; + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page and a marker bullet on its left-hand side.</p> + <div></div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht new file mode 100644 index 0000000..9650741c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to inline-block</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of inline-block." /> + <style type="text/css"> + span#inline-block + { + background: blue; + display: inline-block; + float: right; + height: 1in; + width: 1in; + } + + span.block-descendant + { + color: blue; + display: block; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div> + <span id="inline-block"> + <span class="block-descendant">a</span> + <span class="block-descendant">b</span> + </span> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht new file mode 100644 index 0000000..90dd98d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht
@@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table'." /> + <style type="text/css"> + #table + { + background: blue; + display: table; + table-layout: fixed; + float: right; + width: 1in; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-014.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-014.xht new file mode 100644 index 0000000..ba9c7544 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-014.xht
@@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'inline-table'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'inline-table'." /> + <style type="text/css"> + #table + { + background: blue; + display: inline-table; + table-layout: fixed; + float: right; + width: 1in; + } + .row + { + display: table-row; + } + .cell + { + color: blue; + display: table-cell; + height: 0.5in; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + + <div id="table"> + + <div class="row"> + <div class="cell">a</div><div class="cell">b</div> + </div> + + <div class="row"> + <div class="cell">c</div><div class="cell">d</div> + </div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-015.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-015.xht new file mode 100644 index 0000000..7fe15d3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-applies-to-015.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to element with 'display' set to 'table-caption'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-14 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" /> + <link rel="match" href="../reference/float-applies-to-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The 'float' property applies to elements with a display of 'table-caption'." /> + <style type="text/css"> + #caption + { + background: blue; + display: table-caption; + float: right; + height: 1in; + width: 1in; + } + #table + { + display: table; + width: 100%; + } + #row + { + display: table-row; + } + #cell + { + display: table-cell; + } + </style> + </head> + <body> + <p>Test passes if there is a filled blue square on the right side of the page.</p> + <div id="table"> + <div id="caption"></div> + <div id="row"> + <div id="cell"></div> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001-ref.xht new file mode 100644 index 0000000..f2bd0ed --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001-ref.xht
@@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the blue and orange squares have the same height.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001.xht new file mode 100644 index 0000000..18e2c08 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-height-001.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated non-replaced element with 'margin-top', margin-bottom' set to 'auto' and 'height' relying on the descendants</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-root-margin" /> + <link rel="match" href="float-non-replaced-height-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'height' is 'auto' on an floated non-replaced element then the 'height' depends on the descendants." /> + <style type="text/css"> + #div1 + { + position: relative; + } + #div2 + { + background: blue; + float: left; + } + #div2 div, #div3 + { + height: 1in; + width: 1in; + } + #div3 + { + background: orange; + left: 1in; + position: absolute; + top: 0; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange squares have the same height.</p> + <div id="div1"> + <div id="div2"> + <div></div> + </div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001-ref.xht new file mode 100644 index 0000000..bafa658 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 192px; + width: 192px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the filled blue square is in the <strong>upper-left corner</strong> of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001.xht new file mode 100644 index 0000000..f29a773 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-001.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with 'auto' left margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="match" href="float-non-replaced-width-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'margin-left' is computed as 'auto' its used value is '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + div div + { + background-color: blue; + float: left; + margin-left: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-left corner</strong> of the hollow black square.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002-ref.xht new file mode 100644 index 0000000..6e4936b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 192px; + text-align: center; + width: 192px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the filled blue square is <strong>horizontally centered</strong> inside the hollow black square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht new file mode 100644 index 0000000..06c072f4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with specified left margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="match" href="float-non-replaced-width-002-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'margin-left' is not computed as 'auto' its used value is as specified." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + div div + { + background-color: blue; + float: left; + margin-left: 0.5in; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is <strong>horizontally centered</strong> inside the hollow black square.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003-ref.xht new file mode 100644 index 0000000..342cbf73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 192px; + text-align: right; + width: 192px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the filled blue square is in the <strong>upper-right corner</strong> of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht new file mode 100644 index 0000000..a229e3fe --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with 'auto' right margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="match" href="float-non-replaced-width-003-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'margin-right' is computed as 'auto' its used value is '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + div div + { + background-color: blue; + float: right; + margin-right: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-right corner</strong> of the hollow black square.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht new file mode 100644 index 0000000..45b8ca1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with specified right margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="match" href="float-non-replaced-width-002-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If 'margin-right' is not computed as 'auto' its used value is as specified." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + div div + { + background-color: blue; + float: right; + margin-right: 0.5in; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is <strong>horizontally centered</strong> inside the hollow black square.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-005.xht new file mode 100644 index 0000000..298b4156 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-005.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with left and right margins as 'auto'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="match" href="float-non-replaced-width-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="If both 'margin-left' and margin-right' are computed as 'auto' their used value is as '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + div div + { + background-color: blue; + float: left; + margin-left: auto; + margin-right: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-left corner</strong> of the hollow black square.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-006.xht new file mode 100644 index 0000000..cfd1a9c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-006.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating non-replaced elements with 'auto' width</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + + <meta name="flags" content="ahem" /> + <meta name="assert" content="If 'width' computes to 'auto' then the used value of 'width' is 'shrink-to-fit'." /> + <style type="text/css"> + div + { + background: red; + color: green; + float: left; + font: 100px/1em Ahem; + width: auto; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div>X</div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-007.xht new file mode 100644 index 0000000..aa4e3ce --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-007.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - inline-block and max-width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating, non-replaced element computes to 'auto' or 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; + font: 30px/4 Ahem; + width: auto; + } + + span + { + background-color: green; + display: inline-block; + max-width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div><span>12345678</span></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht new file mode 100644 index 0000000..096f883 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; + font: 30px/4 Ahem; + width: auto; + } + + span + { + background-color: green; + float: left; + max-width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div><span>12345678</span></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht new file mode 100644 index 0000000..8662b46c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; + font: 30px/4 Ahem; + width: auto; + } + + div > div + { + background-color: green; + max-width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div> + <div>12345678</div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht new file mode 100644 index 0000000..c9083564 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' is specified with absolute length, then the computed value is the specified value. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses specified absolute length, then such specified absolute length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; + font: 30px/4 Ahem; + width: auto; + } + + div > div + { + background-color: green; + width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div> + <div>12345678</div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht new file mode 100644 index 0000000..f981957 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - inline-block and max-width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating, non-replaced element computes to 'auto' or 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; + font: 30px/4 Ahem; + width: auto; + } + + div > div + { + background-color: green; + display: inline-block; + max-width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div> + <div>12345678</div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-012.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-012.xht new file mode 100644 index 0000000..2c2cd8d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-012.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> + <link rel="match" href="../positioning/absolute-non-replaced-width-017-ref.xht" /> + <meta content="If 'width' of a floating non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation and such calculated width can be furthermore constrained, reduced by a max-width declaration." name="assert" /> + <meta content="ahem" name="flags" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + float: left; + font: 30px/4 Ahem; + max-width: 4em; + width: auto; + } + ]]></style> + + </head> + + <body> + + <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> + + <div>12345678</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-013.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-013.xht new file mode 100644 index 0000000..60f85bc02 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-013.xht
@@ -0,0 +1,63 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: width - non-replaced float with scrollbar and percentage height of inline replaced child</title> + + <!-- + Credits should go to Erik Brown for originally reporting a related test + --> + + <link rel="bookmark" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281713" title="Bug 1281713: intrinsic width of parent with overflow-x:scroll not computing correctly with child image with height:100%" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" title="11.1.1 Overflow: the 'overflow' property" href="https://www.w3.org/TR/CSS21/visufx.html#overflow" /> + <link rel="help" title="10.3.2 Inline, replaced elements" href="https://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width" /> + <link rel="help" title="10.3.5 Floating, non-replaced elements" href="https://www.w3.org/TR/CSS21/visudet.html#float-width" /> + + <meta name="DC.date.created" content="2016-06-23T09:54:03+11:00" scheme="W3CDTF" /> + <meta name="DC.date.modified" content="2016-07-06T09:54:03+11:00" scheme="W3CDTF" /> + + <!-- + Siblings of this test are: + inline-block-non-replaced-width-005 + absolute-non-replaced-width-028 + --> + + <meta content="image scroll" name="flags" /> + <meta content="This test checks interaction of percentage height of an inline replaced element with its parent having scrollbars and with the parent's width determined by 'shrink-to-fit' width algorithm. In this test, the image height should be 100px minus scrollbar height since space taken up by generated scrollbars should be taken out of (subtracted from the dimensions of) the containing block formed by the element with the scrollbars. Then the width of parent should be (used image height == 100px minus scrollbar) * (intrinsic ratio == 5width:1height)." name="assert" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: red; + float: left; /* or display: inline-block; */ /* or position: absolute; */ + height: 100px; + overflow: scroll; + } + + img + { + height: 100%; + vertical-align: bottom; + /* + This 'vertical-align: bottom' declaration is not part of the test. + We 'baseline-align' the image at the bottom of the line box so + that the vertical scrollbar remains inactive. + */ + } + ]]></style> + + </head> + + <body> + + <p>PREREQUISITE: User agent needs to support scrollbars as the scrolling mechanism. If it does not, then this test does not apply to such user agent.</p> + + <p>Test passes if there is a filled green rectangle with inactive scrollbars and <strong>no red</strong>.</p> + + <div><img src="support/green-rectangle-50wideBy10tall.png" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001-ref.xht new file mode 100644 index 0000000..7fc4dd9d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001-ref.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border-bottom: orange solid medium; + border-top: orange solid medium; + font-size: 16px; + line-height: 15px; + width: 1in; + } + + img + { + margin: 0px; + vertical-align: top; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no white space between the blue box below and the orange lines.</p> + + <div><img src="support/blue15x15.png" width="15" height="15" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht new file mode 100644 index 0000000..a4d8e3d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-001-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="A floated replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'." /> + <style type="text/css"> + div + { + border-bottom: solid orange; + border-top: solid orange; + line-height: 0; + width: 1in; + } + img + { + margin-top: auto; + margin-bottom: auto; + } + div, img + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if there is no white space between the blue box below and the orange lines.</p> + <div> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002-ref.xht new file mode 100644 index 0000000..baaa21e3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002-ref.xht
@@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the blue and orange squares have the same height.</p> + + <div><img src="support/blue15x15.png" width="15" height="15" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="15" height="15" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht new file mode 100644 index 0000000..ca49db81 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements relying on intrinsic height dimensions</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-002-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="The 'height' is the intrinsic height when an floated replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'." /> + <style type="text/css"> + div + { + line-height: 0; + position: relative; + } + div div + { + background: orange; + height: 15px; + left: 15px; + position: absolute; + top: 0; + width: 15px; + } + img + { + height: auto; + width: auto; + } + div, img + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange squares have the same height.</p> + <div> + <img alt="blue 15x15" src="support/blue15x15.png" /> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003-ref.xht new file mode 100644 index 0000000..2eafd48 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003-ref.xht
@@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the blue and orange squares have the same height.</p> + + <div><img src="support/blue15x15.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht new file mode 100644 index 0000000..ca7facb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floating replaced elements with intrinsic ratios and 'height' set to 'auto'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-003-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="The 'height' is the used width divided by the ratio when an floated replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified." /> + <style type="text/css"> + div + { + line-height: 0; + position: relative; + } + div div + { + background: orange; + height: 1in; + left: 1in; + position: absolute; + top: 0; + } + img + { + height: auto; + } + div, img + { + float: left; + } + div div, img + { + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange squares have the same height.</p> + <div> + <img alt="blue 15x15" src="support/blue15x15.png" /> + <div></div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004-ref.xht new file mode 100644 index 0000000..2727852a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: green solid medium; + height: 150px; + width: 300px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004.xht new file mode 100644 index 0000000..2fdeaba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-004.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements without intrinsic ratios and 'height' set to 'auto'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-004-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="For floated replaced elements the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width." /> + <style type="text/css"> + div + { + position: relative; + } + div div + { + border: solid green; + height: 150px; + position: absolute; + top: 0; + width: 300px; + } + iframe + { + border: solid red; + float: left; + height: auto; + width: auto; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div> + <iframe></iframe> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005-ref.xht new file mode 100644 index 0000000..69c56f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: green solid medium; + height: 96px; + width: 300px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005.xht new file mode 100644 index 0000000..f3da0feb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-005.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with percentage based intrinsic height</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-005-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A floated replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified." /> + <style type="text/css"> + #div1 + { + position: relative; + height: 2in; + } + div div + { + border: solid green; + height: 1in; + position: absolute; + top: 0; + width: 300px; + } + iframe + { + border: solid red; + float: left; + width: auto; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <iframe height="50%"></iframe> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006-ref.xht new file mode 100644 index 0000000..c9f487b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006-ref.xht
@@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the blue and orange rectangles have the same height.</p> + + <div><img src="support/blue15x15.png" width="200" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="200" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006.xht new file mode 100644 index 0000000..2d76339e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-006.xht
@@ -0,0 +1,43 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> + <head> + <title>CSS Test: Absolutely positioned floated replaced elements with percentage based intrinsic height</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-006-ref.xht" /> + + <meta name="flags" content="nonHTML svg" /> + <meta name="assert" content="A floated replaced element with percentage intrinsic height resolves based on the containing block when the replaced element is absolutely positioned." /> + <style type="text/css"> + #div1 + { + position: relative; + height: 2in; + } + div div + { + background: orange; + height: 1in; + left: 200px; + position: absolute; + top: 0; + width: 200px; + } + svg + { + float: left; + position: absolute; + width: auto; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange rectangles have the same height.</p> + <div id="div1"> + <svg:svg version="1.1" height="50%" baseProfile="full"> + <svg:rect x="0" y="0" width="200" height="100" fill="blue" /> + </svg:svg> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-007.xht new file mode 100644 index 0000000..3cbb9c26 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-height-007.xht
@@ -0,0 +1,39 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with percentage based intrinsic height that cannot be resolved</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" /> + <link rel="match" href="float-replaced-height-004-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A floated replaced elements with a percentage height that cannot be resolved has no intrinsic height." /> + <style type="text/css"> + #div1 + { + position: relative; + } + div div + { + border: solid green; + height: 150px; + position: absolute; + top: 0; + width: 300px; + } + iframe + { + border: solid red; + float: left; + width: auto; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <iframe height="50%"></iframe> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-001.xht new file mode 100644 index 0000000..d6e353f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-001.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with 'auto' left margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-05-28 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-non-replaced-width-001-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="If 'margin-left' is computed as 'auto' its used value is '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + background-color: blue; + float: left; + margin-left: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-left corner</strong> of the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht new file mode 100644 index 0000000..cb6050b7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with specified left margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-05-28 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-non-replaced-width-002-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="If 'margin-left' is not computed as 'auto' its used value is as specified." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + background-color: blue; + float: left; + margin-left: 0.5in; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is <strong>horizontally centered</strong> inside the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht new file mode 100644 index 0000000..ac4e3aa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with 'auto' right margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-05-28 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-non-replaced-width-003-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="If 'margin-right' is computed as 'auto' its used value is '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + background-color: blue; + float: right; + margin-right: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-right corner</strong> of the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht new file mode 100644 index 0000000..3f1bdc7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with specified right margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-05-28 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-non-replaced-width-002-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="If 'margin-right' is not computed as 'auto' its used value is as specified." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + background-color: blue; + float: right; + margin-right: 0.5in; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is <strong>horizontally centered</strong> inside the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-005.xht new file mode 100644 index 0000000..8553d6a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-005.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements with left and right margins as 'auto'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-05-28 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-non-replaced-width-001-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="If both 'margin-left' and margin-right' are computed as 'auto' their used value is as '0'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + background-color: blue; + float: left; + margin-left: auto; + margin-right: auto; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the <strong>upper-left corner</strong> of the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006-ref.xht new file mode 100644 index 0000000..d36d8cc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 192px; + line-height: 15px; + width: 192px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the small blue and orange squares have the same width and if the blue square is in the upper-left corner of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht new file mode 100644 index 0000000..aee9171 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-replaced-width-006-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on floated replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 2in; + width: 2in; + } + img + { + float: left; + margin-left: auto; + margin-right: auto; + } + div div + { + background: orange; + height: 15px; + margin-top: 15px; + width: 15px; + } + </style> + </head> + <body> + <p>Test passes if the small blue and orange squares have the same width and if the blue square is in the upper-left corner of the hollow black square.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" /> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007-ref.xht new file mode 100644 index 0000000..b5b4772 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 288px; + width: 288px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" height="50" width="200" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" height="50" width="200" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht new file mode 100644 index 0000000..7ab350e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht
@@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> + <head> + <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic height</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-replaced-width-007-ref.xht" /> + + <meta name="flags" content="nonHTML svg" /> + <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on floated replaced elements becomes a used value of '0'. The 'width' is (used height) * (intrinsic ratio) if there is no intrinsic width but there is intrinsic height and ratio." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 3in; + width: 3in; + } + svg + { + float: left; + margin-left: auto; + margin-right: auto; + } + div div + { + background: orange; + height: 50px; + margin-top: 50px; + width: 200px; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + <div id="div1"> + <svg:svg version="1.1" height="50" baseProfile="full"> + <svg:rect x="0" y="0" width="200" height="100" fill="blue" /> + </svg:svg> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008-ref.xht new file mode 100644 index 0000000..d38f145a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 288px; + width: 288px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" height="100" width="200" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" height="100" width="200" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht new file mode 100644 index 0000000..b4500ba6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> + <head> + <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and 'height'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-replaced-width-008-ref.xht" /> + + <meta name="flags" content="nonHTML svg" /> + <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on floated replaced elements becomes a used value of '0'. The 'width' is (used height) * (intrinsic ratio) if there is no intrinsic width but there is intrinsic height and ratio." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 3in; + width: 3in; + } + svg + { + float: left; + height: 100px; + margin-left: auto; + margin-right: auto; + } + div div + { + background: orange; + height: 100px; + margin-top: 100px; + width: 200px; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + <div id="div1"> + <svg:svg version="1.1" height="50" baseProfile="full"> + <svg:rect x="0" y="0" width="200" height="100" fill="blue" /> + </svg:svg> + <div></div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009-ref.xht new file mode 100644 index 0000000..6c8f7a8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 288px; + width: 288px; + } + + img {vertical-align: top;} + + img#blue {margin-bottom: 10px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + + <div><img id="blue" src="support/swatch-blue.png" height="100" width="200" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" height="96" width="200" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht new file mode 100644 index 0000000..b407448e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht
@@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> + <head> + <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and no intrinsic height or width</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-replaced-width-009-ref.xht" /> + + <meta name="flags" content="nonHTML svg" /> + <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on floated replaced elements becomes a used value of '0'. The height and width are adjusted by the constraints for block-level, non-replaced elements." /> + <style type="text/css"> + #div1 + { + border: solid black; + height: 3in; + width: 3in; + } + #div2 + { + height: 110px; + width: 3in; + } + #div3 + { + background: orange; + height: 1in; + width: 200px; + } + svg + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange rectangles have the same width and if the blue rectangle is in the upper-left corner of the hollow black square.</p> + <div id="div1"> + <div id="div2"> + <svg:svg version="1.1" baseProfile="full"> + <svg:rect x="0" y="0" width="200" height="100" fill="blue" /> + </svg:svg> + </div> + <div id="div3"></div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011-ref.xht new file mode 100644 index 0000000..7382999 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + height: 288px; + width: 192px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue and orange squares have the same width and if the blue square is in the upper-left corner of the hollow black rectangle.</p> + + <div><img src="support/swatch-blue.png" height="96" width="96" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" height="96" width="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht new file mode 100644 index 0000000..2cd20662 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width" /> + <link rel="match" href="float-replaced-width-011-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width." /> + <style type="text/css"> + div + { + line-height: 0; + } + #div1 + { + border: solid black; + height: 3in; + width: 2in; + } + img + { + float: left; + margin-left: auto; + margin-right: auto; + } + div div + { + background: orange; + height: 1in; + margin-top: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue and orange squares have the same width and if the blue square is in the upper-left corner of the hollow black rectangle.</p> + <div id="div1"> + <img alt="blue 15x15" src="support/blue15x15.png" width="50%" /> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht new file mode 100644 index 0000000..f060cff --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Floating replaced elements - specified width, height in percentages and intrinsic ratio</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" title="10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements" /> + <link rel="bookmark" href="https://bugs.kde.org/show_bug.cgi?id=274790" title= + "Bug 274790: object specified with width and height percentages and with intrinsic ratio" /> + <meta http-equiv="Content-Style-Type" content="text/css" /> + <meta content="image interact" name="flags" /> + <meta content="When 'height: 1%' (or any other percentage) applies to a floating replaced element and when the height of its containing block is not specified explicitly (i.e., it depends on content height), then such height computes to 'auto'. Then, if such floating replaced element has an intrinsic ratio and its used width is known or resolved, then the used value of 'height' is determined by the equation (used width) / (intrinsic ratio)." name="assert" /> + + <style type="text/css"><![CDATA[ + img {float: left;} + ]]></style> + + </head> + + <body> + + <p>There should be <strong>5 filled green squares</strong> with the same width and the <strong>same height</strong>. The 5 filled green squares should be <strong>identical</strong> to each other. This should still remain true even after a window resize.</p> + + <div> + <img src="support/60x60-green.png" width="15%" alt="FAIL: image download must be enabled" /><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled" /> + + <img src="support/60x60-green.png" width="15%" height="1%" alt="FAIL: image download must be enabled" /><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled" /> + + <img src="support/60x60-green.png" style="width: 15%;" alt="FAIL: image download must be enabled" /><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled" /> + + <img src="support/60x60-green.png" style="width: 15%; height: auto;" alt="FAIL: image download must be enabled" /><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled" /> + + <img src="support/60x60-green.png" style="width: 15%; height: 1%;" alt="FAIL: image download must be enabled" /> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001-ref.xht new file mode 100644 index 0000000..451620a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 1in; + width: 2in; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is on the left inner edge of the hollow black rectangle.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001.xht new file mode 100644 index 0000000..ea6669c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-001.xht
@@ -0,0 +1,39 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats, shifting left until it touches container edge</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A left floated box shifts left until its outer edge touches the containing block edge." /> + <style type="text/css"> + #div1 + { + border: solid 5px black; + height: 1in; + width: 2in; + } + div div + { + display: inline-block; + height: 1in; + width: 1in; + } + #div3 + { + background-color: blue; + float: left; + } + </style> + </head> + <body> + <p>Test passes if the blue square is on the left inner edge of the hollow black rectangle.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002-ref.xht new file mode 100644 index 0000000..e56d388 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 1in; + text-align: right; + width: 2in; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is on the right inner edge of the hollow black rectangle.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002.xht new file mode 100644 index 0000000..0496a75e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-002.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats, shifting right until it touches container edge</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-002-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A right floated box shifts right until its outer edge touches the containing block edge." /> + <style type="text/css"> + #div1 + { + border: solid 5px black; + height: 1in; + width: 2in; + } + div div + { + background-color: blue; + height: 1in; + float: right; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is on the right inner edge of the hollow black rectangle.</p> + <div id="div1"> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-003.xht new file mode 100644 index 0000000..5dc07fc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-003.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats, shifting left until touching other floats</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="adjacent-floats-001-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A left floated box shifts left until it touches another float." /> + <style type="text/css"> + #div1, #div2 + { + height: 1in; + width: 1in; + } + #div1 + { + background-color: orange; + float: left; + } + #div2 + { + background-color: blue; + float: left; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the left of the blue square and the squares top edges are aligned.</p> + <div> + <div id="div1"></div> + <div id="div2"></div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004-ref.xht new file mode 100644 index 0000000..27fc3ea --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + text-align: right; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is to the left of the orange square and the squares top edges are aligned.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004.xht new file mode 100644 index 0000000..edb6884d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-004.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats, shifting right until touching other floats</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-004-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A right floated box shifts right until it touches another float." /> + <style type="text/css"> + #div1, #div2 + { + height: 1in; + width: 1in; + } + #div1 + { + background: orange; + float: right; + } + #div2 + { + background: blue; + float: right; + } + </style> + </head> + <body> + <p>Test passes if the blue square is to the left of the orange square and the squares top edges are aligned.</p> + <div> + <div id="div1"></div> + <div id="div2"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005-ref.xht new file mode 100644 index 0000000..b373808 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 192px; + width: 120px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005.xht new file mode 100644 index 0000000..239f6e34 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-005.xht
@@ -0,0 +1,56 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats, shifting down below all other floated elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-005-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="Floated boxes shift down until it fits." /> + <style type="text/css"> + #parentDiv + { + background: red url('support/floats-005.png'); + width: 1.25in; + } + div + { + float: left; + } + div div + { + background: green; + } + #div1 + { + height: 1in; + width: 1.2in; + } + #div2 + { + height: 1in; + width: 0.75in; + } + #div3 + { + height: 0.25in; + width: 0.2in; + } + #div4 + { + width: 0.5in; + height: 0.25in; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="parentDiv"> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006-ref.xht new file mode 100644 index 0000000..1a018a3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006-ref.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue rectangle is to the left of the orange square and both top edges are aligned.</p> + + <div><img src="support/swatch-blue.png" width="200" height="100" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="100" height="100" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006.xht new file mode 100644 index 0000000..f484da3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-006.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Left floats interacting with inline content</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-006-ref.xht" /> + + <meta name="flags" content="ahem" /> + <meta name="assert" content="Inline boxes are reflowed to the first available line on the other side of a float." /> + <style type="text/css"> + #div1 + { + height: 200px; + width: 300px; + } + #span1 + { + color: orange; + font: 100px/1 Ahem; + } + .class1 + { + background-color: blue; + float: left; + height: 100px; + width: 100px; + } + </style> + </head> + <body> + <p>Test passes if the blue rectangle is to the left of the orange square and both top edges are aligned.</p> + <div id="div1"> + <span id="span1">X</span> + <div class="class1"></div> + <div class="class1"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007-ref.xht new file mode 100644 index 0000000..f456376 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007-ref.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the top edges of the orange and blue squares are aligned and both squares are below the purple rectangle and yellow stripe.</p> + + <div><img src="support/swatch-purple.png" width="120" height="96" alt="Image download support must be enabled" /><br /><img src="support/swatch-yellow.png" width="72" height="24" alt="Image download support must be enabled" /><br /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="120" height="120" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007.xht new file mode 100644 index 0000000..0d57f45 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-007.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated elements shifting down below non-floated elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-007-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Left floated boxes shift down until next to another float and there is room to fit." /> + <style type="text/css"> + #div1 + { + background: purple; + height: 1in; + width: 1.25in; + } + #div2 + { + background: yellow; + height: 0.25in; + width: 0.75in; + } + #div3 + { + background: orange; + float: left; + height: 1in; + width: 1in; + } + #div4 + { + background: blue; + float: left; + height: 1.25in; + width: 1.25in; + } + </style> + </head> + <body> + <p>Test passes if the top edges of the orange and blue squares are aligned and both squares are below the purple rectangle and yellow stripe.</p> + <div> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-008.xht new file mode 100644 index 0000000..236cdb6c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-008.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats and block box flow</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="clear-float-004-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Block boxes flow vertically as if floats don't exist." /> + <style type="text/css"> + div + { + height: 1in; + width: 1in; + } + #div1 + { + background-color: orange; + } + #div2 + { + background-color: blue; + float: left; + } + #div3 + { + background-color: red; + } + </style> + </head> + <body> + <p>Test passes if the orange square is positioned above the blue square and if there is no red.</p> + <div id="div1"></div> + <div id="div2"></div> + <div id="div3"></div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009-ref.xht new file mode 100644 index 0000000..f68d06d0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009-ref.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue rectangle is to the right of the orange square and if the top edges are aligned.</p> + + <div><img src="support/swatch-orange.png" width="100" height="100" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="200" height="100" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009.xht new file mode 100644 index 0000000..2b33109 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-009.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Right floats interacting with right-to-left inline content</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-009-ref.xht" /> + + <meta name="flags" content="ahem" /> + <meta name="assert" content="Inline boxes are reflowed to the first available line on the other side of a float for right-to-left." /> + <style type="text/css"> + #div1 + { + direction: rtl; + height: 200px; + width: 300px; + } + #span1 + { + color: orange; + font: 100px/1 Ahem; + } + .class1 + { + background-color: blue; + float: right; + height: 100px; + width: 100px; + } + </style> + </head> + <body> + <p>Test passes if the blue rectangle is to the right of the orange square and if the top edges are aligned.</p> + <div id="div1"> + <div class="class1"></div> + <div class="class1"></div> + <span id="span1">X</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014-ref.xht new file mode 100644 index 0000000..ffa54ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014-ref.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border: black solid 5px; + border-collapse: separate; + border-spacing: 0px; + padding: 9px; + } + + img {vertical-align: top;} + + td.left-column {padding-right: 10px;} + + td.right-column {padding-left: 10px;} + + td.top-row {padding-bottom: 10px;} + + td.bottom-row {padding-top: 10px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is twice as much space between the blue squares as there is between the blue squares and the black container edge.</p> + + <table> + + <tr><td class="left-column top-row"><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></td><td class="right-column top-row"><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></td></tr> + + <tr><td class="left-column bottom-row"><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></td><td class="right-column bottom-row"><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></td></tr> + + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014.xht new file mode 100644 index 0000000..4efe91c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-014.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Left floated element margins do not collapse</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-014-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Floating boxes never collapse with margins of adjacent floats or other boxes." /> + <style type="text/css"> + #div1 + { + border: solid 5px black; + height: 232px; + width: 232px; + } + div div + { + background: blue; + float: left; + height: 96px; + margin: 10px; + width: 96px; + } + </style> + </head> + <body> + <p>Test passes if there is twice as much space between the blue squares as there is between the blue squares and the black container edge.</p> + <div id="div1"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-015.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-015.xht new file mode 100644 index 0000000..c89789636 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-015.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Right floated elements margins do not collapse</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-014-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Right floating boxes never collapse with margins of adjacent boxes or other floats." /> + <style type="text/css"> + #div1 + { + border: solid 5px black; + height: 232px; + width: 232px; + } + div div + { + background: blue; + height: 96px; + margin: 10px; + width: 96px; + } + #div2, #div4 + { + float: right; + } + #div3 + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if there is twice as much space between the blue squares as there is between the blue squares and the black container edge.</p> + <div id="div1"> + <div id="div2"></div> + <div></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-016.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-016.xht new file mode 100644 index 0000000..7545e192 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-016.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated elements stacked with blocks and inline elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="" /> + <meta name="assert" content="Floated elements are rendered in front of non-positioned in-flow blocks but behind in-flow inline boxes when a normal flow box is next to a floated element with negative margins." /> + <style type="text/css"> + #container + { + margin: 0.5in; + } + #inline + { + background: yellow; + margin-left: -0.5in; + } + #float, #block + { + height: 1in; + width: 1in; + } + #float + { + background: orange; + float: left; + } + #block + { + background: blue; + margin: -0.25in; + } + </style> + </head> + <body> + <p>Test passes if the boxes are partially stacked on top of each other, and they are stacked in the following order from bottom to top: blue, orange, yellow.</p> + <div id="container"> + <span id="inline">Filler Text</span> + <div id="float">Filler Text</div> + <div id="block">Filler Text</div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019-ref.xht new file mode 100644 index 0000000..b8477c0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019-ref.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 1.1in 0px 0px;} + + div + { + background-color: blue; + height: 1in; + left: 0px; + position: absolute; + top: 0px; + width: 1in; + } + + p {margin: 0px;} + ]]></style> + + </head> + + <body> + + <div></div> + + <p>Test passes if the blue square above is in the top-left corner of the page.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019.xht new file mode 100644 index 0000000..cbbbdbc8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-019.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Float applied to absolutely positioned elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-019-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Float cannot be applied to absolutely positioned element." /> + <style type="text/css"> + * + { + margin: 0; + } + div + { + background: blue; + float: right; + height: 1in; + position: absolute; + width: 1in; + } + p + { + padding-top: 1.1in; + } + </style> + </head> + <body> + <div></div> + <p>Test passes if the blue square above is in the top-left corner of the page.</p> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-020.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-020.xht new file mode 100644 index 0000000..31948aa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-020.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Left floated elements and text wrapping</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="" /> + <meta name="assert" content="Block box is generated and floated to left and content flows on right side starting at the top." /> + <style type="text/css"> + div + { + width: 2.25in; + } + #span1 + { + background-color: blue; + float: left; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the words "Filler Text" start above, flow down the right side of, and then wrap underneath the blue box.</p> + <div> + <span>Filler Text Filler Text Filler Text </span> + <span id="span1"></span> + <span>Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-021.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-021.xht new file mode 100644 index 0000000..7dcadf8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-021.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Right floated elements and text wrapping</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="" /> + <meta name="assert" content="Block box is generated and floated to right and content flows on left side starting at the top." /> + <style type="text/css"> + div + { + width: 2in; + } + #span1 + { + background-color: blue; + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the words "Filler Text" start above the blue box and flow down the left side of and wrap underneath the blue box.</p> + <div> + <span>Filler Text Filler Text Filler Text </span> + <span id="span1"></span> + <span>Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022-ref.xht new file mode 100644 index 0000000..5ca7586c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022-ref.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if there are three lines of "Filler Text".</p> + + <div>Filler Text</div> + + <div>Filler Text</div> + + <div>Filler Text</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022.xht new file mode 100644 index 0000000..65d65a0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-022.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Elements do not float when 'float' is set to 'none'</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-022-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="An element with 'float: none' behaves as if it were never set to begin with." /> + <style type="text/css"> + #div1 + { + float: left; + float: none; + } + </style> + </head> + <body> + <p>Test passes if there are three lines of "Filler Text".</p> + <div>Filler Text</div> + <div id="div1">Filler Text</div> + <div>Filler Text</div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023-ref.xht new file mode 100644 index 0000000..3dbbd5e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 192px; + margin: 48px; + width: 192px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the filled blue square is in the upper-left corner of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023.xht new file mode 100644 index 0000000..e232260 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-023.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated elements and container edges</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-023-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Left floated boxes cannot go past the container's left edge." /> + <style type="text/css"> + div + { + border: solid 5px black; + height: 2in; + margin: 0.5in; + width: 2in; + } + span + { + background-color: blue; + float: left; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the filled blue square is in the upper-left corner of the hollow black square.</p> + <div> + <span></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024-ref.xht new file mode 100644 index 0000000..806e171 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024-ref.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border-top: black solid 5px; + width: 300px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange square is to the left of the blue square and the top edges of both squares touch the black line.</p> + + <div><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024.xht new file mode 100644 index 0000000..a3db0f9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-024.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Left float with earlier floated siblings</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-024-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Left floated box is to right of earlier floated box or below the earlier floated element's bottom edge." /> + <style type="text/css"> + div + { + border-top: solid 5px black; + width: 300px; + } + span + { + float: left; + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + } + #span2 + { + background-color: blue; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the left of the blue square and the top edges of both squares touch the black line.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025-ref.xht new file mode 100644 index 0000000..31a385e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 2in; + text-align: right; + width: 2in; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is in the upper-right corner of the hollow black square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025.xht new file mode 100644 index 0000000..1ec5fcc3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-025.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Right floating elements and container edge</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-025-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Right floated boxes cannot go past the container's right edge." /> + <style type="text/css"> + div + { + border: solid 5px black; + height: 2in; + width: 2in; + } + span + { + background-color: blue; + float: right; + height: 1in; + width: 1in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is in the upper-right corner of the hollow black square.</p> + <div> + <span></span> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026-ref.xht new file mode 100644 index 0000000..8e30d4d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 192px; + width: 192px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is aligned on the left side of the hollow black square and is above the orange, right aligned, square.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026.xht new file mode 100644 index 0000000..cd01476 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-026.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin affects left floated elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-026-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Right outer edge of left-floating box cannot be to the right of the left outer edge of any right-floating box that is to the right of it." /> + <style type="text/css"> + div + { + border: solid 5px black; + height: 2in; + width: 2in; + } + span + { + height: 1in; + width: 1in; + } + #span1 + { + background: blue; + float: left; + margin-right: 10px; + } + #span2 + { + background-color: orange; + float: right; + margin-left: 10px; + } + </style> + </head> + <body> + <p>Test passes if the blue square is aligned on the left side of the hollow black square and is above the orange, right aligned, square.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027-ref.xht new file mode 100644 index 0000000..ba3cecc4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 192px; + width: 192px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is aligned on the right side of the hollow black square and is above the orange, left aligned, square.</p> + + <div><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-white.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027.xht new file mode 100644 index 0000000..2ef7987 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-027.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin affects right floated elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-027-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Right outer edge of left-floating box cannot be to the right of the left outer edge of any right-floating box that is to the right of it." /> + <style type="text/css"> + div + { + border: solid 5px black; + height: 2in; + width: 2in; + } + span + { + height: 1in; + width: 1in; + } + #span1 + { + background: blue; + float: right; + margin-left: 10px; + } + #span2 + { + background-color: orange; + float: left; + margin-right: 10px; + } + </style> + </head> + <body> + <p>Test passes if the blue square is aligned on the right side of the hollow black square and is above the orange, left aligned, square.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028-ref.xht new file mode 100644 index 0000000..e6fd0ff --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028-ref.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div#wrapper + { + border: black solid 5px; + bottom: 17px; + height: 192px; + left: 24px; + position: relative; + width: 192px; + } + + div > div + { + background-color: blue; + height: 120px; + width: 120px; + } + + ]]></style> + + </head> + + <body> + + <p>Test passes if the blue square is completely contained within the hollow black square.</p> + + <div id="wrapper"> + <div>Filler Text</div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028.xht new file mode 100644 index 0000000..39006ea --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-028.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats and containment</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-028-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Floating box's outer top cannot be higher than the top of its containing block." /> + <style type="text/css"> + div + { + border: solid 5px black; + height: 2in; + margin: 0.25in; + position: absolute; + top: 10px; + width: 2in; + } + span + { + background-color: blue; + float: left; + height: 1.25in; + width: 1.25in; + } + </style> + </head> + <body> + <p>Test passes if the blue square is completely contained within the hollow black square.</p> + <div> + <span>Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029-ref.xht new file mode 100644 index 0000000..3ade54b2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 112px 0px 0px;} + + div + { + height: 1in; + left: 0px; + position: absolute; + top: 0px; + } + + img {vertical-align: top;} + ]]></style> + + </head> + + <body> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" />Filler Text</div> + + <p>Test passes if the blue square is in the top left corner of the page and the words "Filler Text" are directly to the right of the square.</p> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029.xht new file mode 100644 index 0000000..d5512d2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-029.xht
@@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Content flowing around floated elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-029-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="Floats shift the current line and surrounding content to flow along its side unless clear is specified." /> + <style type="text/css"> + #span1 + { + background-color: blue; + float: left; + height: 1in; + width: 1in; + } + body + { + margin: 0; + } + div div + { + clear: both; + } + </style> + </head> + <body> + <div> + <span>Filler Text</span> + <span id="span1"></span> + <div></div> + </div> + <p>Test passes if the blue square is in the top left corner of the page and the words "Filler Text" are directly to the right of the square.</p> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030-ref.xht new file mode 100644 index 0000000..f9926cb8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030-ref.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div#wrapper + { + border: solid 5px black; + height: 150px; + margin: 10px; + } + + img#orange {margin-top: 10px;} + + span, img#blue {vertical-align: 20px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange box is within the black box, below the words "Filler Text 1", and to the left of both the blue box and the words "Filler Text 2".</p> + + <div id="wrapper"> + <div>Filler Text 1</div> + <div><img id="orange" src="support/swatch-orange.png" width="96" height="106" alt="Image download support must be enabled" /><span>Filler Text 2</span> <img id="blue" alt="Image download support must be enabled" src="support/blue15x15.png" width="96" height="96" /></div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030.xht new file mode 100644 index 0000000..a25c524 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-030.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Position of floated elements in relation to previous elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" title="9.5.1 Positioning the float: the 'float' property"/> + <link rel="match" href="floats-030-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="Outer top of a floating box cannot be higher than the outer top of any block or floated box generated by an element earlier in the source document." /> + <style type="text/css"> + #d1 + { + border: solid 5px black; + margin: 10px; + height: 150px; + } + #span1, img + { + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + float: left; + margin-top: 10px; + padding-top: 10px; + } + </style> + </head> + <body> + <p>Test passes if the orange box is within the black box, below the words "Filler Text 1", and to the left of both the blue box and the words "Filler Text 2".</p> + <div id="d1"> + <div>Filler Text 1</div> + <span>Filler Text 2</span> + <img alt="blue box" src="support/blue15x15.png" /> + <span id="span1"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031-ref.xht new file mode 100644 index 0000000..942bd69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + font: 16px serif; + margin: 10px; + width: 550px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange rectangle is to the left of the "Filler Text" and the blue rectangle is to the right of the "Filler Text".</p> + + <div id="wrapper"><br /><img src="support/swatch-orange.png" width="96" height="48" alt="Image download support must be enabled" />Filler Text Filler Text <img src="support/blue15x15.png" width="96" height="48" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031.xht new file mode 100644 index 0000000..ee794fe9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-031.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Position of floated elements in relation to previous inline elements</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-09 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#float-position" title="9.5.1 Positioning the float: the 'float' property"/> + <link rel="match" href="floats-031-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="Outer top of floating box cannot be higher than the top of any line-box containing a box generated by an element earlier in the source document." /> + <style type="text/css"> + div + { + border: solid 5px black; + font: 16px serif; + margin: 10px; + width: 550px; + } + #span1 + { + background-color: orange; + float: left; + } + #span1, img + { + height: 0.5in; + width: 1in; + } + span span + { + display: inline-block; + width: 550px; + } + </style> + </head> + <body> + <p>Test passes if the orange rectangle is to the left of the "Filler Text" and the blue rectangle is to the right of the "Filler Text".</p> + <div> + <span><span></span>Filler Text Filler Text</span> + <img alt="blue box" src="support/blue15x15.png" /> + <span id="span1"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036-ref.xht new file mode 100644 index 0000000..0c54201 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036-ref.xht
@@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>Test passes if the "Filler Text" below is all on the same line.</p> + + <div>Filler TextFiller Text</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036.xht new file mode 100644 index 0000000..de47a27b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-036.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated left and aligned with current line box</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-036-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A floated elements top edge will be aligned with the top of a line box." /> + <style type="text/css"> + div + { + width: 5in; + } + #span1 + { + float: left; + } + </style> + </head> + <body> + <p>Test passes if the "Filler Text" below is all on the same line.</p> + <div> + <span>Filler Text</span> + <span id="span1">Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-037.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-037.xht new file mode 100644 index 0000000..7d6e15f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-037.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floated right element aligns with current line box</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="" /> + <meta name="assert" content="A line box aligns with the top of a right floated box." /> + <style type="text/css"> + div + { + width: 2in; + } + #span1 + { + float: right; + } + </style> + </head> + <body> + <p>Test passes if the "Filler Text" below is all on the same line.</p> + <div> + <span>Filler Text</span> + <span id="span1">Filler Text</span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038-ref.xht new file mode 100644 index 0000000..d7391cb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038-ref.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid 5px; + height: 192px; + width: 192px; + } + + img {vertical-align: top;} + + img#orange {border: white solid 10px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange square is to the right of the blue square, space needs to also separate the orange square from other squares.</p> + + <div><img src="support/swatch-blue.png" width="48" height="48" alt="Image download support must be enabled" /><img id="orange" src="support/swatch-orange.png" width="48" height="48" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038.xht new file mode 100644 index 0000000..5784a50 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-038.xht
@@ -0,0 +1,56 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats and table margins</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-04 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-038-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The border box of a table cannot overlap any floats in the same block formatting context as the elements itself." /> + <style type="text/css"> + #div1 + { + border: black solid 5px; + height: 2in; + width: 2in; + } + div div + { + height: 0.5in; + width: 0.5in; + } + #div2 + { + background: blue; + float: left; + } + #table + { + background: orange; + display: table; + border: white solid 10px; + } + #row + { + display: table-row; + } + #cell + { + display: table-cell; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the right of the blue square, space needs to also separate the orange square from other squares.</p> + <div id="div1"> + <div id="div2"></div> + <div id="table"> + <div id="row"> + <div id="cell"></div> + </div> + </div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-039.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-039.xht new file mode 100644 index 0000000..03b77c9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-039.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats and block level replaced element margins</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-04 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-038-ref.xht" /> + + <meta name="flags" content="image" /> + <meta name="assert" content="The border box of a block level replaced element cannot overlap any floats in the same block formatting context as the element itself." /> + <style type="text/css"> + #div1 + { + width: 2in; + height: 2in; + border: black solid 5px; + } + div div + { + background: blue; + float: left; + } + div div, img + { + height: 0.5in; + width: 0.5in; + } + img + { + background: orange; + display: block; + border: white solid 10px; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the right of the blue square, space needs to also separate the orange square from other squares.</p> + <div id="div1"> + <div></div> + <img alt="FAIL: Image download support must be enabled" src="support/swatch-orange.png" /> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-040.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-040.xht new file mode 100644 index 0000000..d1acf1e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-040.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats inline-block level element margins</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-03 --> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-038-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The border box of a inline-block level element cannot overlap any floats in the same block formatting context as the element itself." /> + <style type="text/css"> + #div1 + { + width: 2in; + height: 2in; + border: black solid 5px; + } + div div + { + height: 0.5in; + width: 0.5in; + } + #div2 + { + background: blue; + float: left; + } + #div3 + { + background: orange; + display: inline-block; + border: white solid 10px; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the right of the blue square, space needs to also separate the orange square from other squares.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041-ref.xht new file mode 100644 index 0000000..66457bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 48px; + width: 48px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041.xht new file mode 100644 index 0000000..75b93321 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-041.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats and stacking contexts with content</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-041-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The contents of floats are stacked as if floats generated new stacking contexts." /> + <style type="text/css"> + div div + { + height: 0.5in; + width: 0.5in; + } + #div1 + { + background: red; + float: left; + } + #div2 + { + background: green; + display: block; + position: relative; + z-index: 10; + } + #div3 + { + background: red; + position: relative; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div> + <div id="div1"> + <div id="div2"></div> + </div> + <div id="div3"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043-ref.xht new file mode 100644 index 0000000..8354429 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border-top: black solid 5px; + text-align: right; + width: 288px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if the orange square is to the right of the blue square and the top edges of both squares touch the black line.</p> + + <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="96" height="96" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043.xht new file mode 100644 index 0000000..1ea01c9c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-043.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Right float with earlier floated siblings</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-043-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="A right floated box is to left of earlier floated boxes or below the earlier floated element's bottom edge." /> + <style type="text/css"> + div + { + border-top: solid 5px black; + width: 3in; + } + span + { + float: right; + height: 1in; + width: 1in; + } + #span1 + { + background-color: orange; + } + #span2 + { + background-color: blue; + } + </style> + </head> + <body> + <p>Test passes if the orange square is to the right of the blue square and the top edges of both squares touch the black line.</p> + <div> + <span id="span1"></span> + <span id="span2"></span> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101-ref.xht new file mode 100644 index 0000000..787b26c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101-ref.xht
@@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: teal solid 1px; + margin: 4px; + padding: 4px; + } + + div#outer + { + height: 178px; + margin-top: 20px; + width: 178px; + } + + div#inner + { + height: 160px; + width: 160px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are two nested squares and if the inner square is equidistant from the outer square on all sides.</p> + + <div id="outer"> + <div id="inner">This should be inside the inner square.</div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101.xht new file mode 100644 index 0000000..7b3d721e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-101.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Nested floats (no other content)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-26 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/001-demo.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-101-ref.xht" /> + + <style type="text/css"> + div { border: 1px solid teal; padding: 4px; margin: 4px; } + .left { float: left; } + .right { float: right; } + .size { width: 10em; height: 10em; } + </style> + </head> + <body> + <p>Test passes if there are two nested squares and if the inner square + is equidistant from the outer square on all sides.</p> + <div class="left"><div class="size right">This should be inside the inner square.</div></div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-102.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-102.xht new file mode 100644 index 0000000..47be234 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-102.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Nested floats (some inline content before nested float)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/002-demo.html" type="text/html" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <style type="text/css"> + div { border: 1px solid teal; padding: 4px; margin: 4px; } + .left { float: left; } + .right { float: right; } + .size { width: 150px; height: 150px; } + </style> + </head> + <body> + + <p>The content before should be to the right of the inner square, + and both it and the inner square should be surrounded by an outer box.</p> + + <div class="left">content before <div class="size left"></div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-103.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-103.xht new file mode 100644 index 0000000..c662c65 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-103.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Nested floats (some inline content after nested float)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/003-demo.html" type="text/html" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + + <style type="text/css"> + div { border: 1px solid teal; padding: 4px; margin: 4px; } + .left { float: left; } + .right { float: right; } + .size { width: 150px; height: 150px; } + </style> + </head> + <body> + + <p>The content after should be to the right of the inner square, + and both it and the inner square should be surrounded by an outer box.</p> + + <div class="left"><div class="size left"></div> content after</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-104.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-104.xht new file mode 100644 index 0000000..636e6f93 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-104.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Unexpected Presences, Part 1</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/004.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <style type="text/css"> + body * { margin: 4px; padding: 4px; border: 1px solid; display: block; } + .test { border-color: blue; width: 40em; } + .float { border-color: fuchsia; float: left; width: 5em; height: 5em; } + .first { border-color: purple; margin-left: 10em; } + .second { border-color: teal; } + </style> + </head> + <body> + <div class="test"> + <div class="first"> This is the first block, with a big left margin. At the end + of this block is a left float which should be square. Text that + follows this box should flow to the right of the float; the float + should always be on the left. <div class="float"> This is the square left + float. </div> </div> + <div class="second"> This is the second block. It should fit in the same + container as the first box. This text should wrap on the right side + of the float. </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-105.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-105.xht new file mode 100644 index 0000000..2dbc24f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-105.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Unexpected Presences, Part 2</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/005.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <style type="text/css"> + body * { margin: 4px; padding: 4px; border: 1px solid; display: block; } + .test { border-color: blue; width: 40em; } + .float { border-color: fuchsia; float: left; width: 5em; height: 5em; } + .first { border-color: purple; margin-left: 10em; } + .second { border-color: teal; width: 10em; } + </style> + </head> + <body> + <div class="test"> + <div class="first"> This is the first block, with a big left margin. At the end + of this block is a left float which should be square. Text that + follows this box should flow to the right of the float or go below + it; no text should be on the left of the float. <div class="float"> This is + the square left float. </div> </div> + <div class="second"> This is the second block. It is sized so as to be just + wide enough to slightly overlap the float. Text shouldn't be able + to fit around the float without overflowing this box, so instead + all the text should just move below the float. </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-106.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-106.xht new file mode 100644 index 0000000..4b1cc71 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-106.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Unexpected Presences, Part 3</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/006.html" type="text/html"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/006.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <style type="text/css"> + body * { margin: 4px; padding: 4px; border: 1px solid; display: block; } + .test { border-color: blue; width: 40em; } + .float { border-color: fuchsia; float: left; width: 5em; height: 5em; } + .first { border-color: purple; margin-left: 10em; } + .second { border-color: teal; width: 8em; } + </style> + </head> + <body> + <div class="test"> + <div class="first"> This is the first block, with a big left + margin. At the end of this block is a left float which should be + square. Text that follows this box should flow to the right of the + float or go below it; no text should be on the left of the float. + <div class="float"> This is the square left float. </div> </div> + <div class="second"> This is the second block. It is sized so as to + be just narrow enough to fit in the gap to the left of the + float. Text should not want to be to the left of the float, since + it is a left float in flow, so instead all the text should just + move below the float. </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-108.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-108.xht new file mode 100644 index 0000000..a9878100 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-108.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled floats) </title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/008.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/008.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-109.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-109.xht new file mode 100644 index 0000000..ebdbadc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-109.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (blocks inside styled floats)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/009.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/009.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-110.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-110.xht new file mode 100644 index 0000000..86b6470e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-110.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/010.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/010.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + + <meta name="flags" content="interact" /> + <style type="text/css"> + .float { float: left; } + .float div { margin: 0; border: solid; padding: 0.5em; margin: 0.5em; } + </style> + </head> + <body> + + <p> Make your window an inch or two bigger than than the width of + one float. All floats should be the same size. This document should + be pixel-perfect identical to <a href="008.xml">this one</a> and <a + href="009.xml">this one</a> at all window sizes. Try resizing the + window so that floats wrap in one or two columns. </p> + + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float this is a float this is a float this is a float this is a float </div> </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111-ref.xht new file mode 100644 index 0000000..ef2233f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111-ref.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + border: black solid medium; + height: 40px; + margin: 40px; + width: 40px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical filled green squares with a black border.</p> + + <div></div> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111.xht new file mode 100644 index 0000000..bae8c3d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-111.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Shrink Wrapped Right Floats With Right Aligned Text</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/011.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/011.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-111-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"><![CDATA[ + .container { width: 40%; padding: 0; margin: 1em; border: solid black; font: 2.5em/1 Ahem; height: 1em; width: 1em; background: red; } + .test { text-align: right; float: right; clear: right; color: green; } + ]]></style> + </head> + <body> + + <p>Test passes if there are 2 identical filled green squares with a black border.</p> + <div class="container"> <div class="test">x</div> </div> + <div class="container"> <div class="test"> x </div> </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112-ref.xht new file mode 100644 index 0000000..9967bfa9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112-ref.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + border: black solid medium; + height: 40px; + margin: 40px; + width: 80px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical filled green rectangles with a black border.</p> + + <div></div> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112.xht new file mode 100644 index 0000000..ba61234 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-112.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Shrink Wrapped Right Floats With Right Aligned Text</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/012.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/012.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-112-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"><![CDATA[ + .container { width: 40%; padding: 0; margin: 1em; border: solid black; font: 2.5em/1 Ahem; height: 1em; width: 2em; background: red; } + .test { text-align: right; float: right; clear: right; color: green; } + ]]></style> + </head> + <body> + + <p>Test passes if there are 2 identical filled green rectangles with a black border.</p> + <div class="container"> <div class="test">xx</div> </div> + <div class="container"> <div class="test"> xx </div> </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113-ref.xht new file mode 100644 index 0000000..9d3f8fda --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113-ref.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: black solid medium; + background-color: green; + height: 40px; + margin: 40px; + text-align: center; + width: 120px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical rectangles with a black border.</p> + + <div><img src="support/swatch-white.png" width="40" height="40" alt="Image download support must be enabled" /></div> + + <div><img src="support/swatch-white.png" width="40" height="40" alt="Image download support must be enabled" /></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113.xht new file mode 100644 index 0000000..9cae6fe --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-113.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Shrink Wrapped Right Floats With Right Aligned Text</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-07 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/013.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/013.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-113-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"><![CDATA[ + .container { width: 40%; padding: 0; margin: 1em; border: solid black; font: 2.5em/1 Ahem; height: 1em; width: 3em; background: white; } + .test { text-align: right; float: right; clear: right; color: green; } + ]]></style> + </head> + <body> + + <p>Test passes if there are 2 identical rectangles with a black border.</p> + <div class="container"> <div class="test">x x</div> </div> + <div class="container"> <div class="test"> x x </div> </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114-ref.xht new file mode 100644 index 0000000..3f81ae6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114-ref.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + border: navy solid 3px; + margin: 1em 0em; + padding: 8px; + } + ]]></style> + + </head> + + <body> + + <p>The following three lines should be identical and should read 'PASS' as one unbroken word:</p> + + <div>PASS</div> + + <div>PASS</div> + + <div>PASS</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114.xht new file mode 100644 index 0000000..feb189a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-114.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Generated Content</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/014.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/014.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-114-ref.xht" /> + + <style type="text/css"> + .test { border: solid navy; padding: 0.5em; } + .a:before { float: none; content: 'PA'; width: 5em; } + .b:before { float: left; content: 'PA'; } + .c:after { float: left; content: 'PA'; height: 5em } + </style> + </head> + <body> + <p> The following three lines should be identical and should read 'PASS' as one unbroken word:</p> + <p class="test a">SS</p> + <p class="test b">SS</p> + <p class="test c">SS</p> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115-ref.xht new file mode 100644 index 0000000..5d789d042 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 50px; + width: 200px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115.xht new file mode 100644 index 0000000..0a587ff45 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-115.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/015.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-115-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; width: 200px; height: 50px; background: red; } + .float { float: left; background: green; color: green; font: 50px/1 Ahem; } + </style> + </head> + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + <div class="test"> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116-ref.xht new file mode 100644 index 0000000..298be90 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 150px; + width: 300px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116.xht new file mode 100644 index 0000000..2796e83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-116.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing (with padding)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/016.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-116-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; width: 300px; height: 150px; background: red; } + .float { float: left; background: green; color: green; font: 50px/1 Ahem; padding: 50px; } + </style> + </head> + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + <div class="test"> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-117.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-117.xht new file mode 100644 index 0000000..e5c06f9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-117.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing (with border)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/017.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-116-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; width: 300px; height: 150px; background: red; } + .float { float: left; color: green; font: 50px/1 Ahem; border: 50px solid green; } + </style> + </head> + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + <div class="test"> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118-ref.xht new file mode 100644 index 0000000..e5208bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: navy; + height: 25px; + margin-bottom: 10px; + width: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical navy stripes.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118.xht new file mode 100644 index 0000000..72b1130f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-118.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/018.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-118-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; } + span { display: block; width: 100px; height: 25px; margin-bottom: 10px; background: navy; } + .float { float: left; color: navy; font: 25px/1 Ahem; } + </style> + </head> + <body> + + <p>Test passes if there are 2 identical navy stripes.</p> + <div class="test"> + <span /> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119-ref.xht new file mode 100644 index 0000000..684cef2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: navy; + height: 75px; + margin-bottom: 10px; + width: 150px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical filled navy rectangles and <strong>no red</strong>.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119.xht new file mode 100644 index 0000000..4b63f912 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-119.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing (with padding)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/019.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-119-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; } + span { display: block; width: 150px; height: 75px; margin-bottom: 10px; background: navy; } + .float { float: left; background: navy; color: navy; font: 25px/1 Ahem; padding: 25px; } + </style> + </head> + <body> + + <p>Test passes if there are 2 identical filled navy rectangles and <strong>no red</strong>.</p> + <div class="test"> + <span/> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-120.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-120.xht new file mode 100644 index 0000000..64e20b2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-120.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing (with border)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/020.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-119-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .test { display: block; } + span { display: block; width: 150px; height: 75px; margin-bottom: 10px; background: navy; } + .float { float: left; background: red; color: navy; font: 25px/1 Ahem; border: solid navy 25px; } + </style> + </head> + <body> + <p>Test passes if there are 2 identical filled navy rectangles and <strong>no red</strong>.</p> + <div class="test"> + <span/> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121-ref.xht new file mode 100644 index 0000000..99d2b81 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + border: white solid medium; + height: 50px; + margin: 66px 50px 50px 50px; + width: 200px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121.xht new file mode 100644 index 0000000..7024922 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-121.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Fixed Sizing (with border)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/021.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-121-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + #container { display: block; width: 299px; background: red; color: green; font: 50px/1 Ahem; border: solid white; } + .float { float: left; margin: 50px; } + </style> + </head> + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + <div id="container"> + <div class="test1"/> + <div class="test2"/> + <div class="float">XXXX</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122-ref.xht new file mode 100644 index 0000000..b9c1d5a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 50px; + margin: auto auto auto 50px; + width: 50px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122.xht new file mode 100644 index 0000000..341e38b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-122.xht
@@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing Float Followed By Text</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/022.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-122-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + #container { display: block; width: 100px; background: red; color: green; font: 50px/1 Ahem; position: relative; } + .float { float: left; color: white; } + </style> + </head> + <body> + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + <div id="container"> + <div class="float">X</div>X + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123-ref.xht new file mode 100644 index 0000000..2b6134f0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 50px; + width: 50px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123.xht new file mode 100644 index 0000000..a00ac83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-123.xht
@@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Auto Sizing (with relative positioning)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/023.xml" type="application/xhtml+xml"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-123-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + #container { display: block; width: 150px; background: red; position: relative; } + .float { float: left; color: green; font: 50px/1 Ahem; } + </style> + </head> + <body> + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + <div id="container"><div class="float">X</div></div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124-ref.xht new file mode 100644 index 0000000..5be82a4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + color: white; + display: inline; + line-height: 1; + vertical-align: top; + } + ]]></style> + + </head> + + <body> + + <div>There should be no red on this page.</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124.xht new file mode 100644 index 0000000..3a0a3e9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-124.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Bottom Padding on Inline Children</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/024.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/024.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-124-ref.xht" /> + + <style type="text/css"> + /* reset everything to be sure we don't introduce oddities */ + div { border: 0; padding: 0; margin: 0; line-height: 1; float: left; } + span { border: 0; padding: 0; margin: 0; line-height: 1; display: inline; } + + /* the test */ + div { background: red; } + span.control { background: green; color: white; } + span.test { padding-bottom: 10em; } + </style> + </head> + <body> + <div> + <span class="test"><span class="control">There should be no red on this page.</span></span> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125-ref.xht new file mode 100644 index 0000000..47ba036f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125-ref.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + line-height: 1; + margin-top: 12em; + } + + span + { + background-color: green; + color: white; + vertical-align: top; + } + ]]></style> + + </head> + + <body> + + <div><span>There should be no red on this page.</span></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125.xht new file mode 100644 index 0000000..1468dd9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-125.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Bottom Padding on Inline Children</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/025.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/025.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-125-ref.xht" /> + + <style type="text/css"> + /* reset everything to be sure we don't introduce oddities */ + div { border: 0; padding: 0; margin: 0; line-height: 1; float: left; } + span { border: 0; padding: 0; margin: 0; line-height: 1; display: inline; } + + /* the test */ + body { margin-top: 12em; } + div { background: red; } + span.control { background: green; color: white; } + span.test { padding-top: 10em; } + </style> + </head> + <body> + <div> + <span class="test"><span class="control">There should be no red on this page.</span></span> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-126.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-126.xht new file mode 100644 index 0000000..d3aea7b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-126.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled floated tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/026.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/026.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; display: table; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-127.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-127.xht new file mode 100644 index 0000000..348167ca --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-127.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled floated tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/027.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/027.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; display: table; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-128.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-128.xht new file mode 100644 index 0000000..3b18f49 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-128.xht
@@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled blocks within floated tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/028.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/028.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .float { float: left; display: table; } + .float div { margin: 0; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-129.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-129.xht new file mode 100644 index 0000000..b0a6855 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-129.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled floated tables within tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/029.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/029.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .table { display: table; } + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; display: table; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="table"> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + <div class="float"> this is a float this is a float this is a float </div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-130.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-130.xht new file mode 100644 index 0000000..7eae100 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-130.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (blocks within styled floated tables within tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/030.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/030.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .table { display: table; } + .float { float: left; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; display: table; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="table"> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + </div> + + </body> +</html> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-131.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-131.xht new file mode 100644 index 0000000..7dacb91 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-131.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Float Sizing (styled blocks within floated tables within tables)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/031.xml" type="application/xhtml+xml"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/031.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="interact"/> + <style type="text/css"> + .table { display: table; } + .float { float: left; display: table; } + .float div { margin: 0; border: solid blue; color: silver; padding: 0.5em; margin: 0.5em; } + </style> + </head> + <body> + + <p><strong>All blue boxes must always be the same size</strong>. Make your + window an inch or two bigger than than the width of one box to check. Try + resizing the window so that the boxes wrap in two or more columns. Try + resizing the window to be narrower than the boxes so that the text inside + them wraps into two or more lines.</p> + + <div class="table"> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + <div class="float"> <div> this is a float this is a float this is a float </div> </div> + </div> + + </body> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132-ref.xht new file mode 100644 index 0000000..26a9891 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132-ref.xht
@@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + width: 10em; + } + + div + div + { + background-color: lime; + } + ]]></style> + + </head> + + <body> + + <p>There should be two layers of green below.</p> + + <div></div> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132.xht new file mode 100644 index 0000000..e16e2db9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-132.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Wrapping long text</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/032.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-132-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .container { font: 20px/1 Ahem; width: 8em; height: 2em; background: red; } + .box { height: 1em; background: green; color: lime; } + .float { width: 1em; height: 1em; float: left; background: green; } + </style> + </head> + <body> + <p>There should be two layers of green below.</p> + <div class="container"> + <div class="box"> + <div class="float"></div> + xxxxxxxx + </div> + </div> + </body> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133-ref.xht new file mode 100644 index 0000000..46ab18f9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 20px; + width: 20px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133.xht new file mode 100644 index 0000000..963f619 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-133.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Wrapping text and position:static</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/033.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-133-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .container { font: 20px/1 Ahem; width: 2em; height: 1em; background: red; } + .box { height: 1em; color: white; } + .float { width: 1em; height: 1em; float: left; background: green; } + </style> + </head> + <body> + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + <div class="container"> + <div class="box"> + <div class="float"></div> + x + </div> + </div> + </body> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-134.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-134.xht new file mode 100644 index 0000000..065b090 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-134.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Wrapping text and position:relative</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/034.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-133-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .container { font: 20px/1 Ahem; width: 2em; height: 1em; background: red; } + .box { height: 1em; color: white; position: relative; } + .float { width: 1em; height: 1em; float: left; background: green; } + </style> + </head> + <body> + <p>Test passes if there is a small filled green square and <strong>no red</strong>.</p> + <div class="container"> + <div class="box"> + <div class="float"></div> + x + </div> + </div> + </body> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135-ref.xht new file mode 100644 index 0000000..0684379 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 5em; + width: 15em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135.xht new file mode 100644 index 0000000..ff2924a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-135.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Wrapping blocks around floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/035.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-135-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .container { width: 15em; height: 5em; background: green; } + .float { width: 5em; height: 5em; background: green; float: left; } + .box { width: 5em; height: 5em; background: red; margin: 0; padding: 0; border: 0; } + </style> + </head> + <body> + <p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p> + <div class="container"> + <div class="float"></div> + <div class="box"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136-ref.xht new file mode 100644 index 0000000..48466c8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 30px; + width: 60px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a small filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136.xht new file mode 100644 index 0000000..f13315af --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-136.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: CSS Floats: Wrapping blocks around floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/036.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-136-ref.xht" /> + + <meta name="flags" content="ahem" /> + <style type="text/css"> + .container { font: 30px/1 Ahem; color: green; margin: 0; padding: 0; border: 0; + background: url(support/60x60-red.png) no-repeat; + text-indent: 0; } + .float { width: 1em; height: 1em; background: green; float: left; + margin: 0; padding: 0; border: 0; } + </style> + </head> + <body> + <p>Test passes if there is a small filled green rectangle and <strong>no red</strong>.</p> + <div class="container"> + <div class="float"></div> + X + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-137.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-137.xht new file mode 100644 index 0000000..4ec41b49 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-137.xht
@@ -0,0 +1,87 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Wrapping text around multiple floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/wrapping/001.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="ahem animated"/> + <style type="text/css"> + .ahem { font: 1.25em/1 Ahem; background: yellow; color: navy; } + div.ahem { border: solid 1em navy; width: 10em; height: 10em; } + pre.ahem { width: 12em; height: 12em; } + span { font: 0.75em/1 serif; } + + body.a .ahem, body.b .ahem { position: absolute; margin: 1em; } + body.a div.ahem { display: none; } + body.b pre.ahem { display: none; } + + .aleft { text-align: left; } + .aright { text-align: right; } + .acenter { text-align: center; } + .ajustify { text-align: justify; } + + .fleft { float: left; } + .fright { float: right; } + .fleft, .fright { background: navy; } + + .cleft { clear: left; } + .cright { clear: right; } + .cleft.cright { clear: both; } + + .w1 { width: 1em; } .h1 { height: 1em; } + .w2 { width: 2em; } .h2 { height: 2em; } + .w3 { width: 3em; } .h3 { height: 3em; } + .w4 { width: 4em; } .h4 { height: 4em; } + .w5 { width: 5em; } .h5 { height: 5em; } + + </style> + </head> + <body class="test"> + <p>If scripting is supported: there should be only a single static jumble below with the word + "Control" blinking steadily. If there are two squares, or if the + square is animated, then the test has failed.</p> + + <p>If scripting is unsupported: there should be two identical + patterned squares below.</p> + + <script type="text/javascript"> + var body = document.body; + var timer; + function toggle() { + body.className = body.className == 'a' ? 'b' : 'a'; + timer = window.setTimeout(toggle, 500); + } + toggle(); + </script> + + <p><button onclick="clearTimeout(timer); body.className = 'test';"> Examine </button></p> + + <div class="ahem"> + 1 + <div class="fleft w2 h2"></div> + 222222222 + <div class="fleft w1 h2"></div> + <div class="fleft w1 h5"></div> + <div class="fleft w1 h1"></div> + <div class="fleft w2 h2"></div> + <div class="fleft w1 h1"></div> + 3 444 55555555 66666 777777777 + </div> + + <pre class="ahem">############ +#AA1 # +#AA # +#B222222222# +#BCDEEF3 # +# C EE444 # +# C55555555# +# C66666 # +# C # +#777777777 # +# # +############ <span>Control</span> +</pre> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138-ref.xht new file mode 100644 index 0000000..d23da7c7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138-ref.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div {color: navy;} + + div + div {text-indent: 10em;} + ]]></style> + + </head> + + <body> + + <p>There should be two lines below, the second indented some way across.</p> + + <div>Line 1</div> + + <div>Line 2</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138.xht new file mode 100644 index 0000000..7d5746d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-138.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Clearing a float with margins</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/038.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-138-ref.xht" /> + + <style type="text/css"> + div { color: navy; } + .float { float: left; width: 8em; } + .indent { margin: 0 0 0 10em; } + .clear { clear: both; } + </style> + </head> + <body> + <p>There should be two lines below, the second indented some way across.</p> + <div class="float">Line 1</div> + <div class="indent"> + <div class="clear">Line 2</div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139-ref.xht new file mode 100644 index 0000000..0b6c19c0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139-ref.xht
@@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + </head> + + <body> + + <p>PASS</p> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139.xht new file mode 100644 index 0000000..f130e44 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-139.xht
@@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: Ultra basic test</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/039.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-139-ref.xht" /> + + <style type="text/css"> + span { float: left; } + </style> + </head> + <body> + <p><span>PA</span>SS</p> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-140.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-140.xht new file mode 100644 index 0000000..2537eb4c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-140.xht
@@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: negative margin test</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/040.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + + <style type="text/css"> + p { margin-left: 5em; } + span { float: left; margin-left: -5em; width: 5em; text-align: right; } + </style> + </head> + <body> + <p><span>PA</span>SS</p> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141-ref.xht new file mode 100644 index 0000000..e852244 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141-ref.xht
@@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + p {color: blue;} + + div#wrapper + { + border: none 0px; + display: inline-block; + margin: 0em; + padding: 0em; + } + + div + { + border: solid thin; + margin: 0.2em; + padding: 0.2em; + } + + div#A + { + color: fuchsia; + width: 12em; + } + + div#B + { + color: orange; + display: inline-block; + width: 8em; + } + + div#C + { + color: orange; + display: inline-block; + width: 4em; + } + ]]></style> + + </head> + + <body> + + <p>C must not be above B.</p> + + <div id="wrapper"> + <div id="A">A</div> + <div id="B">B</div><div id="C">C</div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141.xht new file mode 100644 index 0000000..15fb41f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-141.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: No higher than earlier floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/041.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-141-ref.xht" /> + + <style type="text/css"> + p { color: blue; } + .container { width: 20em; } + .float { float: left; padding: 0.2em; margin: 0.2em; border: thin solid; } + .a { color: fuchsia; width: 12em; } + .b { color: orange; width: 8em; } + .c { color: orange; width: 4em; } + </style> + </head> + <body> + <p>C must not be above B.</p> + <div class="container"> + <div class="float a">A</div> + <div class="float b">B</div> + <div class="float c">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142-ref.xht new file mode 100644 index 0000000..c2ca05d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142-ref.xht
@@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + color: green; + width: 10em; + } + ]]></style> + + </head> + + <body> + + <p>There should be a short green bar with no text in it.</p> + + <div>X</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142.xht new file mode 100644 index 0000000..c64f889 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-142.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: negative margin test</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-08 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/042.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-142-ref.xht" /> + + <style type="text/css"> + div { background: green; } + div p { margin-left: 10em; background: white; color: white; } + div p span { float: left; margin-left: -8em; } + </style> + </head> + <body> + <p>There should be a short green bar with no text in it.</p> + <div> + <p> FAIL <span></span> </p> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143-ref.xht new file mode 100644 index 0000000..49d1fe5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + color: white; + display: inline-block; + font: 900 2em/1 sans-serif; + } + ]]></style> + + </head> + + <body> + + <p>There should be a single green block with the word "PASS" below.</p> + + <div>PASS</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143.xht new file mode 100644 index 0000000..84acecc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-143.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Nested floats: Basic</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-14 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/043.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-143-ref.xht" /> + + <style type="text/css"> + .float { float: left; background: red; padding: 0; margin: 0; list-style: none; } + .text { font: 900 2em/1 sans-serif; background: green; color: white; } + </style> + </head> + <body> + <p>There should be a single green block with the word "PASS" below.</p> + <ul class="float"> + <li class="float"> <span class="float text"> PA </span></li> + <li class="float"> <span class="float text"> SS </span></li> + </ul> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144-ref.xht new file mode 100644 index 0000000..f39570e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144-ref.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div {color: green;} + ]]></style> + + </head> + + <body> + + <div>This line should be green (line 1).</div> + + <div>This line should be green (line 2).</div> + + <div>This line should be green (line 3).</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144.xht new file mode 100644 index 0000000..89e33dc5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-144.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats inside blocks</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/044.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-144-ref.xht" /> + + <style type="text/css"> + p { float: left; color: green; margin: 0; } + div { background: red; clear: both; } + div.a { } + div.b { width: 30em; } + div.c { height: 0; } + </style> + </head> + <body> + <div class="a"><p>This line should be green (line 1).</p></div> + <div class="b"><p>This line should be green (line 2).</p></div> + <div class="c"><p>This line should be green (line 3).</p></div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145-ref.xht new file mode 100644 index 0000000..0cde7b4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + img + { + margin-top: 90px; + vertical-align: top; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a blue bar.</p> + + <div><img src="support/swatch-blue.png" width="330" height="30" alt="Image download support must be enabled" /></div> + + </body> +</html> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145.xht new file mode 100644 index 0000000..48862b5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-145.xht
@@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Bottom margins on floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/045.html" type="text/html"/> + <link rel="bookmark" href="https://github.com/servo/servo/pull/10458#issuecomment-210204244" /> + <link rel="bookmark" href="http://lists.w3.org/Archives/Public/public-css-testsuite/2016Apr/0028.html" title="About floats-145" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-145-ref.xht" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: blue; + float: left; + font: 30px/3 Ahem; /* computes to 30px/90px */ + } + + span + { + background-color: white; + color: white; + float: left; + margin-bottom: 1em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a blue bar.</p> + + <div><span>Text sample</span></div> + + </body> +</html> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146-ref.xht new file mode 100644 index 0000000..63f25fa5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146-ref.xht
@@ -0,0 +1,54 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + p {color: blue;} + + div {font-size: 20px;} + + div#A + { + border: fuchsia solid 1px; + color: fuchsia; + margin: 20px 4px 4px 4px; + padding: 4px; + width: 240px; + } + + span + { + border: orange solid 1px; + color: orange; + display: inline-block; + margin: 4px; + padding: 4px; + } + + span#B + { + margin-right: 8px; + width: 280px; + } + + span#C {width: 80px;} + ]]></style> + + </head> + + <body> + + <p>C must not be above B.</p> + + <div id="A">A</div> + + <div><span id="B">B</span><span id="C">C</span></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146.xht new file mode 100644 index 0000000..9aa4be34 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-146.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: No higher than earlier floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-04-05 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/046.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-146-ref.xht" /> + + <style type="text/css"> + p { color: blue; } + .container { font-size: 20px; width: 20em; } + .float { padding: 0.2em; margin: 0.2em; border: 1px solid; } + .a { color: fuchsia; width: 12em; float: left; } + .b { color: orange; width: 14em; float: left; } + .c { color: orange; width: 4em; float: right; } + </style> + </head> + <body> + <p>C must not be above B.</p> + <div class="container"> + <div class="float a">A</div> + <div class="float b">B</div> + <div class="float c">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147-ref.xht new file mode 100644 index 0000000..a25459d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: blue; + border-color: orange; + border-style: none solid; + border-width: 1em; + height: 3em; + width: 14em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a single blue rectangle with a vertical orange stripe on each side.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147.xht new file mode 100644 index 0000000..e75a7e84 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-147.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats: No more to the right than the right edge of the containing block</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/047-demo.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-147-ref.xht" /> + + <style type="text/css"> + .outer { width: 15em; background: red; border-left: 1em solid orange; } + .container { width: 9em; margin-left: 4em; background: orange; + height: 1em; line-height: 1; + border: 1em transparent; border-style: none solid; } + .float { float: right; width: 14em; background: blue; color: blue; } + .control { width: 14em; height: 1em; background: blue; + border-left: 1em solid orange; border-right: 1em solid orange; } + </style> + </head> + <body> + <p>Test passes if there is a single blue rectangle with a vertical + orange stripe on each side.</p> + <div class="control"></div> + <div class="outer" dir="ltr"> + <div class="container"> + <div class="float">TEST-LTR</div> + </div> + </div> + <div class="outer" dir="rtl"> + <div class="container"> + <div class="float">TEST-RTL</div> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149-ref.xht new file mode 100644 index 0000000..cd3b0c1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149-ref.xht
@@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border-spacing: 0px; + table-layout: fixed; + width: 100%; + } + + td + { + padding: 0px; + vertical-align: top; + width: 50%; + } + + div {background-color: green;} + ]]></style> + + </head> + + <body> + + <table> + <tr> + <td>There should be a green bar to the right: ⇨</td> + <td><div> </div></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149.xht new file mode 100644 index 0000000..cae42669 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-149.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Empty inlines being displaced by floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 --> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/049.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-149-ref.xht" /> + + <style type="text/css"> + .block { display: block; background: green; } + .inline { display: inline; margin-left: 40px; } + span { float: left; width: 50%; background: white; } + </style> + </head> + <body> + <div class="block"> + <div class="inline"> + <span>There should be a green bar to the right: ⇨</span> + <span></span> <!-- this float should be on the second "line" --> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150-ref.xht new file mode 100644 index 0000000..addea70a2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150-ref.xht
@@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + body {margin: 3.5em 12.5em 3.5em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150.xht new file mode 100644 index 0000000..6976438 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-150.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Positioning of floats in tables: auto-width floats with negative outer width</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/050.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-150-ref.xht" /> + + <style type="text/css"> + body { padding: 2em 12em; } + td { padding: 0; background: red; } + div { float: right; margin-left: -10em; color: white; } + </style> + </head> + <body> + <p>Test passes if there is <strong>no red</strong>.</p> + <table> + <tr> + <td> + <div>FAIL</div> + </td> + </tr> + </table> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-151.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-151.xht new file mode 100644 index 0000000..91f314c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-151.xht
@@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Positioning of floats in tables: auto-width floats with negative outer width</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/051.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + + <style type="text/css"> + td { padding: 2em 5em; } + div { float: right; margin-left: -10em; color: white; background: green; } + </style> + </head> + <body> + <p>Test passes if there is the word PASS with a green background.</p> + <table> + <tr> + <td> + <div>PASS</div> + </td> + </tr> + </table> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-152.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-152.xht new file mode 100644 index 0000000..42df8c1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-152.xht
@@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Positioning of floats in tables: zero-width floats with negative outer width</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/052.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-150-ref.xht" /> + + <style type="text/css"> + body { padding: 2em 12em; } + td { padding: 0; background: red; } + div { width: 0; float: right; margin-left: -10em; color: white; } + </style> + </head> + <body> + <p>Test passes if there is <strong>no red</strong>.</p> + <table> + <tr> + <td> + <div>FAIL</div> + </td> + </tr> + </table> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153-ref.xht new file mode 100644 index 0000000..dc4796e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153-ref.xht
@@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + color: green; + display: inline; + left: 82px; + position: relative; + top: 34px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is the green word PASS.</p> + + <div>PASS</div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153.xht new file mode 100644 index 0000000..67129c4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-153.xht
@@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Positioning of floats in tables: zero-width floats with negative outer width</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/053.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-153-ref.xht" /> + + <style type="text/css"> + td { padding: 2em 5em; } + div { width: 0; float: right; margin-left: -10em; color: green; background: red; } + </style> + </head> + <body> + <p>Test passes if there is the green word PASS.</p> + <table> + <tr> + <td> + <div>PASS</div> + </td> + </tr> + </table> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154-ref.xht new file mode 100644 index 0000000..e15ec10 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 128px; + width: 128px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154.xht new file mode 100644 index 0000000..5d704feb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-154.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Stacking contexts of relatively positioned content inside floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/054.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-154-ref.xht" /> + + <style type="text/css"> + body { font-size: 8em; } + p { font-size: medium; } + .float { float: left; height: 1em; width: 1em; margin-right: -1em; background: red; } + .relative { position: relative; height: 1em; width: 1em; background: green; } + .inline { color: red; } + </style> + </head> + <body> + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + <div class="float"><div class="relative"></div></div> + <div class="inline">X</div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001-ref.xht new file mode 100644 index 0000000..979298d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 300px; + width: 300px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a big filled green square and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001.xht new file mode 100644 index 0000000..aa97aee --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-001.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats with overflow:hidden next to them</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" /> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/root-formatting-contexts/001.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-bfc-001-ref.xht" /> + + <style type="text/css"> + .outer { background: red; height: 300px; width: 300px; } + .block { background: green; height: auto; width: 300px; } + .float { background: green; height: 150px; width: 150px; float: left; } + .overflow { background: green; height: 150px; width: 200px; overflow: hidden; } + </style> + </head> + <body> + <p>Test passes if there is a big filled green square and <strong>no red</strong>.</p> + <div class="outer"> + <div class="block"> + <div class="float"></div> + <div class="overflow"></div> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-002.xht new file mode 100644 index 0000000..3292e3b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/floats-bfc-002.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Floats with overflow:hidden next to them</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" /> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/root-formatting-contexts/002.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <link rel="match" href="floats-bfc-001-ref.xht" /> + + <style type="text/css"> + .outer { background: green; height: 300px; width: 300px; } + .block { background: red; height: auto; width: 300px; } + .float { background: green; height: 150px; width: 150px; float: left; } + .overflow { background: green; height: 150px; width: 150px; overflow: hidden; } + </style> + </head> + <body> + <p>Test passes if there is a big filled green square and <strong>no red</strong>.</p> + <div class="outer"> + <div class="block"> + <div class="float"></div> + <div class="overflow"></div> + </div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht new file mode 100644 index 0000000..499ed22 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht
@@ -0,0 +1,54 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin collapsing - element with clearance</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="match" href="clearance-006-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="An element that has clearance applied to it will not collapse its top margin with its parent's bottom margin." /> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #div1 + { + background: url('support/margin-collapse-4em-space.png'); + height: 6em + } + .class1 + { + background: green; + height: 1em; + } + #div2 + { + margin-bottom: 1em; + } + #div3 + { + float: left; + height: 3em; + } + #div4 + { + clear: both; + margin-top: 1em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <div class="class1"></div> + <div id="div2"> + <div id="div3"></div> + <div id="div4"></div> + </div> + <div class="class1"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-023.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-023.xht new file mode 100644 index 0000000..46425d55 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-023.xht
@@ -0,0 +1,51 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin collapsing - clearance applied to sibling</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="match" href="clearance-006-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="If an in-flow block-level sibling (#div4) has clearance applied to it, then it will not adjoin its top margin with the bottom margin of its previous in-flow sibling (#div2)." /> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #div3 + { + float: left; + height: 3em; + } + #div1 + { + background: url('support/margin-collapse-4em-space.png'); + height: 6em; + } + #div2 + { + margin-bottom: 1em; + } + #div4 + { + clear: both; + margin-top: 2em; + } + #div2, #div4 + { + background: green; + height: 1em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"></div> + <div id="div4"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024-ref.xht new file mode 100644 index 0000000..25ad380 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024-ref.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 1.25em; + margin: 1em 0em 2.5em; + width: 6.25em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is no red.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024.xht new file mode 100644 index 0000000..ace298e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-024.xht
@@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin collapsing - in-flow block-level margin adjoining child's margin</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="match" href="margin-collapse-024-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="When an in-flow block-level element (#div3) is adjoining its in-flow block-level child's top margin and the child has no top border, no top padding or no clearance applied to it, then such top margins collapse." /> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #div1 + { + background: url('support/margin-collapse-2em-space.png'); + height: 4em; + } + #div2, #div4 + { + background: green; + height: 1em; + } + #div3 + { + background: red; + } + #div3, #div4 + { + margin-top: 2em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <div id="div2"></div> + <div id="div3"> + <div id="div4"></div> + </div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht new file mode 100644 index 0000000..bf45954 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht
@@ -0,0 +1,58 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin collapsing - bottom margin not collapse when cleared</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="match" href="clearance-006-ref.xht" /> + + <meta name="flags" content="ahem image" /> + <meta name="assert" content="When a last sibling has clearance, its own margins collapse and it collapsed its margins with a subsequent sibling, the last sibling does not collapse its bottom margin with its parent's bottom margin." /> + <style type="text/css"> + div + { + font: 20px/1em Ahem; + width: 5em; + } + #div1 + { + background: url('support/margin-collapse-4em-space.png'); + height: 6em; + } + #div2 + { + margin-bottom: 2em; + } + #div3, #div5 + { + margin-bottom: 1em; + } + #div3, #div6 + { + background: green; + height: 1em; + } + #div4 + { + float: left; + height: 1em; + } + #div5 + { + clear: both; + margin-top: 1.5em; + } + </style> + </head> + <body> + <p>Test passes if there is no red.</p> + <div id="div1"> + <div id="div2"> + <div id="div3"></div> + <div id="div4"></div> + <div id="div5"></div> + </div> + <div id="div6"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031-ref.xht new file mode 100644 index 0000000..d021e994 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031-ref.xht
@@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + color: white; + margin-top: 100px; + } + ]]></style> + + </head> + + <body> + + <div>Test passes if there is <strong>no red</strong>.</div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031.xht new file mode 100644 index 0000000..3e559588 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-031.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: margin collapsing - child has no clearance</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="match" href="margin-collapse-031-ref.xht" /> + + <meta name="flags" content="" /> + <meta name="assert" content="The top margin of an in-flow block-level element is adjoining to its first in-flow block-level child's top margin if the element has no top border, no top padding, and the child has no clearance." /> + + <style type="text/css"><![CDATA[ + body + { + background-color: white; + margin: 8px; + } + + div#parent-block-container + { + background-color: red; + margin: 0px; + width: 100%; + } + + div#child-block + { + background-color: green; + color: white; + margin: 100px 0px; + } + ]]></style> + + </head> + + <body> + + <div id="parent-block-container"> + <div id="child-block"> + Test passes if there is <strong>no red</strong>. + </div> + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht new file mode 100644 index 0000000..89c8af3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht
@@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: margin collapsing - clear</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Matt Bradley" href="http://www.inventpartners.com/content/contact" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + <meta content="" name="flags" /> + <meta content="Margin-top of following siblings of a block on which 'clear' has been set (to a different value than 'none') must not be substracted when calculating clearance. When an element's own margins collapse, and that element has had clearance applied to it, its top margin collapses with the adjoining margins of following siblings." name="assert" /> + + <style type="text/css"><![CDATA[ + div#overlapped-red + { + background-color: red; + height: 100px; + position: absolute; + width: 100px; + z-index: -1; + } + + div#overlapping-green-container + { + background-color: green; + width: 100px; + } + + div#floated-left + { + float: left; + height: 1px; + } + + div#clear-left {clear: left;} + + div#following-sibling {margin-top: 99px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + + <div id="overlapped-red"></div> + + <div id="overlapping-green-container"> + <div id="floated-left"></div> + + <div id="clear-left"></div> + + <div id="following-sibling"></div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht new file mode 100644 index 0000000..17c11e5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht
@@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: margin collapsing - clear</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Matt Bradley" href="http://www.inventpartners.com/content/contact" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + <meta content="" name="flags" /> + <meta content="Margin-top of following siblings of a block on which 'clear' has been set (to a different value than 'none') must not be substracted when calculating clearance. When an element's own margins collapse, and that element has had clearance applied to it, its top margin collapses with the adjoining margins of following siblings." name="assert" /> + + <style type="text/css"><![CDATA[ + div#overlapped-red + { + background-color: red; + height: 100px; + position: absolute; + width: 100px; + z-index: -1; + } + + div#overlapping-green-container + { + background-color: green; + width: 100px; + } + + div#floated-right + { + float: right; + height: 1px; + } + + div#clear-right {clear: right;} + + div#following-sibling {margin-top: 99px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + + <div id="overlapped-red"></div> + + <div id="overlapping-green-container"> + <div id="floated-right"></div> + + <div id="clear-right"></div> + + <div id="following-sibling"></div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht new file mode 100644 index 0000000..608bdd9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht
@@ -0,0 +1,69 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: margin collapsing - clear</title> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Matt Bradley" href="http://www.inventpartners.com/content/contact" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> + <meta content="" name="flags" /> + <meta content="Margin-top of following siblings of a block on which 'clear' has been set (to a different value than 'none') must not be substracted when calculating clearance. When an element's own margins collapse, and that element has had clearance applied to it, its top margin collapses with the adjoining margins of following siblings." name="assert" /> + + <style type="text/css"><![CDATA[ + div#overlapped-red + { + background-color: red; + height: 100px; + position: absolute; + width: 100px; + z-index: -1; + } + + div#overlapping-green-container + { + background-color: green; + width: 100px; + } + + div#floated-left + { + float: left; + height: 1px; + } + + div#floated-right + { + float: right; + height: 1px; + } + + div#clear-both {clear: both;} + + div#following-sibling {margin-top: 99px;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + + <div id="overlapped-red"></div> + + <div id="overlapping-green-container"> + <div id="floated-left"></div> + + <div id="floated-right"></div> + + <div id="clear-both"></div> + + <div id="following-sibling"></div> + </div> + + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121-ref.xht new file mode 100644 index 0000000..f74b1e6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121-ref.xht
@@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td {padding: 0px;} + + td.square { height: 4em; width: 4em; } + td.rectangle { height: 4em; width: 8em; } + td.lime { background-color: lime; } + td.aqua { background-color: aqua; } + td.yellow { background-color: yellow; } + ]]></style> + + </head> + + <body> + + <p>The following two squares should be identical.</p> + + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table><table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht new file mode 100644 index 0000000..8b6141e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht
@@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear (control: no margins)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/021.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-121-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; } + .comparator { border-spacing: 1em; } + .test, .control { border: solid; background: red; } + .test .container { display: block; margin: 0; width: 8em; background: lime; } + .test .float { float: left; margin: 0; height: 4em; width: 4em; background: aqua; } + .test .clear { clear: left; display: block; border: 2em solid yellow; margin: 0; } + .control .square { height: 4em; width: 4em; } + .control .rectangle { height: 4em; width: 8em; } + .control .lime { background: lime; } + .control .aqua { background: aqua; } + .control .yellow { background: yellow; } + </style> + </head> + <body> + <p>The following two squares should be identical.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table> + </td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht new file mode 100644 index 0000000..17081a2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht
@@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear (simple)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/022.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-121-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; vertical-align: top; } + .comparator { border-spacing: 1em; } + .test, .control { border: solid; background: red; } + .test .container { display: block; margin: 0; width: 8em; background: lime; } + .test .float { float: left; margin: 0; height: 4em; width: 4em; background: aqua; } + .test .clear { clear: left; display: block; border: 2em solid yellow; margin-top: 1em; } + .control .square { height: 4em; width: 4em; } + .control .rectangle { height: 4em; width: 8em; } + .control .lime { background: lime; } + .control .aqua { background: aqua; } + .control .yellow { background: yellow; } + </style> + </head> + <body> + <p>The following two squares should be identical.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table> + </td> + </tr> + </table> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123-ref.xht new file mode 100644 index 0000000..80dc48a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123-ref.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + background-color: orange; + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td + { + height: 2em; + padding: 0px; + width: 3em; + } + + td.yellow {background-color: yellow;} + ]]></style> + + </head> + + <body> + + <p>The following two rectangles should be identical.</p> + + <table> + <tr> + <td></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td></td> + </tr> + </table><table> + <tr> + <td></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht new file mode 100644 index 0000000..db83b34 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht
@@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear (with nearby collapse-through block)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/023.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-123-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; } + .comparator { border-spacing: 1em; } + .test, .control { background: red; } + .test .container { display: block; margin: 0; width: 6em; background: yellow; border: solid; } + .test .float { float: left; margin: 0; height: 2em; width: 3em; background: orange; } + .test .empty { display: block; background: red; margin: 2em 0; } + .test .clear { clear: left; display: block; border-top: 2em solid orange; margin-top: 1em; } + .control table { border: solid; } + .control .square { height: 2em; width: 3em; } + .control .thin { height: 2em; width: 6em; } + .control .thick { height: 2em; width: 6em; } + .control .yellow { background: yellow; } + .control .orange { background: orange; } + </style> + </head> + <body> + <p>The following two rectangles should be identical.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="float"> </div> + <div class="empty"> </div> + <div class="clear"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td class="square orange"></td> + <td class="square yellow"></td> + </tr> + <tr> + <td colspan="2" class="thin orange"></td> + </tr> + </table> + </td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125-ref.xht new file mode 100644 index 0000000..10e21f4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125-ref.xht
@@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td {padding: 0px;} + + td.square { height: 4em; width: 4em; } + td.rectangle { height: 2em; width: 8em; } + td.lime { background-color: lime; } + td.aqua { background-color: aqua; } + td.yellow { background-color: yellow; } + ]]></style> + + </head> + + <body> + + <p>The following two rectangles should be identical.</p> + + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table><table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht new file mode 100644 index 0000000..42b39e5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht
@@ -0,0 +1,52 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear (on a self-collapsing block with a margin)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/025.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-125-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; vertical-align: top; } + .comparator { border-spacing: 1em; } + .test, .control { border: solid; background: red; } + .test .container { display: block; margin: 0; width: 8em; background: lime; } + .test .float { float: left; margin: 0; height: 4em; width: 4em; background: aqua; } + .test .clear { clear: left; display: block; background: red; margin: 2em 0; } + .test .block { display: block; margin: 1em 0 0; border-top: 2em solid yellow; } + .control .square { height: 4em; width: 4em; } + .control .rectangle { height: 2em; width: 8em; } + .control .lime { background: lime; } + .control .aqua { background: aqua; } + .control .yellow { background: yellow; } + </style> + </head> + <body> + <p>The following two rectangles should be identical.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + <div class="block"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + </table> + </td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134-ref.xht new file mode 100644 index 0000000..53eb983 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134-ref.xht
@@ -0,0 +1,67 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td {height: 1em; width: 8em; padding: 0px;} + + .lime { background-color: lime; } + .yellow { background-color: yellow; } + .green { background-color: green; } + ]]></style> + + </head> + + <body> + + <p>The following three rectangles should be identical, with no red present.</p> + + <div><table> + <tr> + <td class="lime"></td> + </tr> + <tr> + <td class="yellow"></td> + </tr> + <tr> + <td class="green"></td> + </tr> + </table><table> + <tr> + <td class="lime"></td> + </tr> + <tr> + <td class="yellow"></td> + </tr> + <tr> + <td class="green"></td> + </tr> + </table></div> + + <table> + <tr> + <td class="lime"></td> + </tr> + <tr> + <td class="yellow"></td> + </tr> + <tr> + <td class="green"></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht new file mode 100644 index 0000000..a777b655 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht
@@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear with no floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/034.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-134-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; } + .comparator { border-spacing: 1em; } + .test, .control { border: solid; background: red; } + + .test .container { display: block; background: yellow; margin: 0; width: 8em; } + .test .block { display: block; border-top: 1em solid lime; margin: 0 0 0 0; } + .test .clear { display: block; border-top: 1em solid green; margin: 1em 0 0 0; clear: right; } + + .control .lime { background: lime; height: 1em; width: 8em; } + .control .yellow { background: yellow; height: 1em; width: 8em; } + .control .green { background: green; height: 1em; width: 8em; } + + </style> + </head> + <body> + <p>The following three rectangles should be identical, with no red present.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="block"> </div> + <div class="clear"> </div> + </div> + </td> + <td class="control"> + <div class="lime"> </div> + <div class="yellow"> </div> + <div class="green"> </div> + </td> + </tr> + <tr> + <td class="control"> + <div class="lime"> </div> + <div class="yellow"> </div> + <div class="green"> </div> + </td> + <td></td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135-ref.xht new file mode 100644 index 0000000..d13dc5a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135-ref.xht
@@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div {border: lime solid 1em;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135.xht new file mode 100644 index 0000000..85647a0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-135.xht
@@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: negative margins with clear</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/035.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-135-ref.xht" /> + + <style type="text/css"> + .container { background: red; height: auto; border: 1em lime solid; } + div { clear: both; } + .a { margin-top: 1em; margin-bottom: 1em; } + .b { margin-top: 1em; margin-bottom: 1em; } + .c { margin-top: 1em; margin-bottom: 1em; } + .d { margin-top: 1em; margin-bottom: 1em; } + .e { margin-top: 1em; margin-bottom: -1em; } + .f { margin-top: 1em; margin-bottom: 1em; } + </style> + </head> + <body> + <p>Test passes if there is <strong>no red</strong>.</p> + <div class="container"> + <div class="a"> + <div class="b"> </div> + <div class="c"> </div> + </div> + <div class="d"> + <div class="e"> </div> + <div class="f"> </div> + </div> + </div> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142-ref.xht new file mode 100644 index 0000000..faccb468 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142-ref.xht
@@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td {padding: 0px;} + + td.square { height: 4em; width: 4em; } + td.rectangle { height: 4em; width: 8em; } + td.lime { background-color: lime; } + td.aqua { background-color: aqua; } + td.yellow { background-color: yellow; } + td.palegreen { background-color: #AFA; } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 2 identical tall rectangles and <strong>no red</strong>.</p> + + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + <tr> + <td colspan="2" class="rectangle lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle palegreen"></td> + </tr> + </table><table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + <tr> + <td colspan="2" class="rectangle lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle palegreen"></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht new file mode 100644 index 0000000..07fdd75 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht
@@ -0,0 +1,59 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margin Collapsing: clear (hard)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/042.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-142-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; vertical-align: top; } + .comparator { border-spacing: 1em; } + .test, .control { border: solid; background: red; } + .test .container { display: block; margin: 0; width: 8em; background: lime; } + .test .float { float: left; margin: 0; height: 4em; width: 4em; background: aqua; } + .test .clear { clear: left; display: block; background: yellow; margin: 4em 0; height: 4em; } + .test .block { display: block; margin: 1em 0 0; border: 2em solid #AAFFAA; } + .control .square { height: 4em; width: 4em; } + .control .rectangle { height: 4em; width: 8em; } + .control .AAFFAA { background: #AAFFAA; } + .control .lime { background: lime; } + .control .aqua { background: aqua; } + .control .yellow { background: yellow; } + </style> + </head> + <body> + <p>Test passes if there are 2 identical tall rectangles and <strong>no red</strong>.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + <div class="block"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td class="square aqua"></td> + <td class="square lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle yellow"></td> + </tr> + <tr> + <td colspan="2" class="rectangle lime"></td> + </tr> + <tr> + <td colspan="2" class="rectangle AAFFAA"></td> + </tr> + </table> + </td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157-ref.xht new file mode 100644 index 0000000..1a782b0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157-ref.xht
@@ -0,0 +1,82 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + div.lime + { + background-color: lime; + border: black solid medium; + width: 8em; + } + + div.aqua + { + background-color: aqua; + height: 4em; + width: 4em; + } + + div.yellow + { + background-color: yellow; + height: 4em; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there are 6 identical squares and <strong>no red</strong>.</p> + + <table> + <tr> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + </tr> + <tr> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + <td> + <div class="lime"> + <div class="aqua"></div> + <div class="yellow"></div> + </div> + </td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht new file mode 100644 index 0000000..ab3ca14 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht
@@ -0,0 +1,79 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<!-- This is similar to tests 022 and 023 --><head> + <title>CSS Test: Margin Collapsing: clear (varying margins)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/057.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-157-ref.xht" /> + + <style type="text/css"> + .test { border: solid; background: red; width: 8em; } + .container { background: lime; } + .float { float: left; height: 4em; width: 4em; background: aqua; } + .empty { margin: 1em; background: red; } + .clear { clear: left; border-bottom: 4em solid yellow; background: red; } + .a .clear { margin-top: 0em; } + .b .clear { margin-top: 1em; } + .c .clear { margin-top: 2em; } + </style> + </head> + <body> + <p>Test passes if there are 6 identical squares and <strong>no red</strong>.</p> + <table> + <tr> + <td> + <div class="test a"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + </div> + </div> + </td> + <td> + <div class="test b"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + </div> + </div> + </td> + <td> + <div class="test c"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> </div> + </div> + </div> + </td> + </tr> + <tr> + <td> + <div class="test a"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> <div class="empty"> </div> </div> + </div> + </div> + </td> + <td> + <div class="test b"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> <div class="empty"> </div> </div> + </div> + </div> + </td> + <td> + <div class="test c"> + <div class="container"> + <div class="float"> </div> + <div class="clear"> <div class="empty"> </div> </div> + </div> + </div> + </td> + </tr> + </table> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158-ref.xht new file mode 100644 index 0000000..4608e11 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158-ref.xht
@@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + background-color: orange; + border: black solid medium; + border-spacing: 0px; + display: inline-table; + margin: 1em 0em auto 1em; + } + + td + { + height: 2em; + padding: 0px; + width: 3em; + } + + td.yellow {background-color: yellow;} + ]]></style> + + </head> + + <body> + + <p>Test passes if the 2 squares are identical.</p> + + <table> + <tr> + <td class="yellow"></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td></td> + </tr> + </table><table> + <tr> + <td class="yellow"></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td class="yellow"></td> + </tr> + <tr> + <td></td> + <td></td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht new file mode 100644 index 0000000..31a0a9f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht
@@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<!-- variant of 023 --><head> + <title>CSS Test: Margin Collapsing: clear (with nearby collapse-through block)</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/058.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-158-ref.xht" /> + + <style type="text/css"> + table, td { padding: 0; border-spacing: 0; } + .comparator { border-spacing: 1em; } + .test, .control { background: red; } + .test .container { display: block; margin: 0; width: 6em; background: yellow; border: solid; } + .test .float { float: left; margin: 0; height: 2em; width: 3em; background: orange; } + .test .empty { display: block; background: red; margin: 2em 0; } + .test .clear { clear: left; display: block; border-top: 2em solid orange; margin-top: 1em; } + .control table { border: solid; } + .control .square { height: 2em; width: 3em; } + .control .thin { height: 2em; width: 6em; } + .control .thick { height: 2em; width: 6em; } + .control .yellow { background: yellow; } + .control .orange { background: orange; } + </style> + </head> + <body> + <p>Test passes if the 2 squares are identical.</p> + <table class="comparator"> + <tr> + <td class="test"> + <div class="container"> + <div class="empty"> </div> + <div class="float"> </div> + <div class="empty"> </div> + <div class="clear"> </div> + </div> + </td> + <td class="control"> + <table> + <tr> + <td colspan="2" class="thick yellow"></td> + </tr> + <tr> + <td class="square orange"></td> + <td class="square yellow"></td> + </tr> + <tr> + <td colspan="2" class="thin orange"></td> + </tr> + </table> + </td> + </tr> + </table> + + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-164.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-164.xht new file mode 100644 index 0000000..ad076ee --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-164.xht
@@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margins on cleared blocks that contain floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/064.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + + <style type="text/css"> + .outer { margin: 1em; background: red; height: 4.5em; } + .border { border: solid; width: 10em; } + .box { margin: 0; background: yellow; } + .float { margin: 0; width: 5em; height: 1.5em; background: orange; float: right; } + .clear { margin-top: 3em; height: 1.5em; background: aqua; clear: both; } + .control { border: solid; width: 10em; background: yellow; margin: 1em; } + .control .a { margin: 0 0 0 auto; width: 5em; height: 1.5em; background: orange; } + .control .b { margin-top: 1.5em; height: 1.5em; background: aqua; } + </style> + </head> + <body> + <p>The following two boxes should be identical, with no red present.</p> + <div class="outer border"> + <div class="box"> + <div class="float">TEST</div> + <div class="clear">TEST</div> + </div> + </div> + <div class="control"> + <div class="a">TEST</div> + <div class="b">TEST</div> + </div> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165-ref.xht new file mode 100644 index 0000000..4007bfa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165-ref.xht
@@ -0,0 +1,75 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + td {padding: 0;} + + div.control + { + background-color: yellow; + border: black solid medium; + width: 7em; + } + + div.a + { + background-color: aqua; + height: 1.5em; + margin: 0 0 0 auto; + width: 4em; + } + + div.b {height: 0.5em;} + + div.c {background-color: orange;} + ]]></style> + + </head> + + <body> + + <p>Test passes if there are <strong>4 identical rectangles</strong> and no red.</p> + + <table> + <tr> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + <tr> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165.xht new file mode 100644 index 0000000..14a7ccd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-165.xht
@@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margins on cleared blocks that contain floats</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/065.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-165-ref.xht" /> + + <style type="text/css"> + td { padding: 0; background: red; } + .border { border: solid; width: 7em; } + .box { margin: 0; background: yellow; } + .float { margin: 0; width: 4em; height: 1.5em; background: aqua; float: right; } + .clear { margin: 2em 0 0 0; background: orange; clear: both; } + .control { border: solid; width: 7em; background: yellow; } + .control .a { margin: 0 0 0 auto; width: 4em; height: 1.5em; background: aqua; } + .control .b { height: 0.5em; } + .control .c { background: orange; } + </style> + </head> + <body> + <p>Test passes if there are <strong>4 identical rectangles</strong> and no red.</p> + <table> + <tr> + <td> + <div class="outer"> + <div class="box border"> + <div class="float">TEST</div> + <div class="clear">TEST</div> + </div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + <tr> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + </table> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-166.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-166.xht new file mode 100644 index 0000000..7bbd95d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-166.xht
@@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CSS Test: Margins on cleared blocks that contain floats, with dynamic border changes</title> + <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> + <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/066.html" type="text/html"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-165-ref.xht" /> + + <style type="text/css"> + td { padding: 0; background: red; } + .border { width: 7em; /* border: solid; added by script at bottom of test */ } + .box { margin: 0; background: yellow; } + .float { margin: 0; width: 4em; height: 1.5em; background: aqua; float: right; } + .clear { margin: 2em 0 0 0; background: orange; clear: both; } + .control { border: solid; width: 7em; background: yellow; } + .control .a { margin: 0 0 0 auto; width: 4em; height: 1.5em; background: aqua; } + .control .b { height: 0.5em; } + .control .c { background: orange; } + </style> + </head> + <body> + <p>Test passes if there are <strong>4 identical rectangles</strong> and no red.</p> + <table> + <tr> + <td> + <div class="outer"> + <div id="test" class="box border"> + <div class="float">TEST</div> + <div class="clear">TEST</div> + </div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + <tr> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + <td> + <div class="control"> + <div class="a">TEST</div> + <div class="b"></div> + <div class="c">TEST</div> + </div> + </td> + </tr> + </table> + <script type="text/javascript"> + var x = document.getElementById('test'); + x.clientHeight; // force reflow + x.style.border = "solid"; // did reflow happen? + </script> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002-ref.xht new file mode 100644 index 0000000..ebb55af7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002-ref.xht
@@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border-collapse: separate; + border-spacing: 0px; + } + + td#first-column {padding: 0px 4px 0px 6px;} + + td#second-column + { + border: black solid thin; + padding: 0px; + width: 150px; + } + + div {height: 50px;} + + div.sliver-yellow {border-left: yellow solid 10px;} + + div.sliver-aqua + { + border-left: 5px solid aqua; + height: 20px; + } + + div.sliver-orange {border-left: orange solid 10px;} + + div.yellow {background-color: yellow;} + + div.aqua + { + background-color: aqua; + height: 20px; + width: 20px; + } + + div.orange {background-color: orange;} + ]]></style> + + </head> + + <body> + + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + + <table> + <tr> + <td id="first-column"> + <div class="sliver-yellow"></div> + <div><div class="sliver-aqua"></div></div> + <div class="sliver-orange"></div> + </td> + <td id="second-column"> + <div class="yellow">A</div> + <div><div class="aqua">B</div></div> + <div class="orange">C</div> + </td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht new file mode 100644 index 0000000..c9fd896 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-clear-002-ref.xht" /> + + <style type="text/css"> + div.target1 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid yellow; top: 0px; } + div.target2 { position: absolute; left: -15px; height: 20px; width: 0; border-left: 5px solid aqua; top: 50px; } + div.target3 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid orange; top: 100px; } + div.container { width: 150px; position: relative; margin-left: 20px; border: solid thin; } + div.box1 { height: 50px; background-color: yellow; } + div.box2 { background-color: aqua; float: left; width: 20px; height: 20px; } + div.box3 { clear: left; margin-top: 50px; height: 50px; background-color: orange; } + </style> + </head> + <body> + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="box1">A</div> + <div class="box2">B</div> + <div class="box3">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003-ref.xht new file mode 100644 index 0000000..7c23b6b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003-ref.xht
@@ -0,0 +1,86 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + + <style type="text/css"><![CDATA[ + table + { + border-collapse: separate; + border-spacing: 0px; + } + + td#first-column {padding: 0px 4px 0px 6px;} + + td#second-column + { + border: black solid thin; + padding: 0px; + width: 150px; + } + + div {height: 50px;} + + div.sliver-yellow {border-left: yellow solid 10px;} + + div.sliver-aqua + { + border-left: 5px solid aqua; + height: 20px; + } + + div.mid-container {height: 60px;} + + div.white + { + border-left: 5px solid white; + height: 40px; + } + + div.sliver-orange {border-left: orange solid 10px;} + + div.yellow {background-color: yellow;} + + div.aqua + { + background-color: aqua; + height: 20px; + width: 20px; + } + + div.orange {background-color: orange;} + ]]></style> + + </head> + + <body> + + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + + <table> + <tr> + <td id="first-column"> + <div class="sliver-yellow"></div> + <div class="mid-container"> + <div class="white"></div> + <div class="sliver-aqua"></div> + </div> + <div class="sliver-orange"></div> + </td> + <td id="second-column"> + <div class="yellow">A</div> + <div class="mid-container"> + <div class="white"></div> + <div class="aqua">B</div> + </div> + <div class="orange">C</div> + </td> + </tr> + </table> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht new file mode 100644 index 0000000..f789279a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht
@@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="match" href="margin-collapse-clear-003-ref.xht" /> + + <style type="text/css"> + div.target1 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid yellow; top: 0px; } + div.target2 { position: absolute; left: -15px; height: 20px; width: 0; border-left: 5px solid aqua; top: 90px; } + div.target3 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid orange; top: 110px; } + div.container { width: 150px; position: relative; margin-left: 20px; border: solid thin; } + div.box1 { height: 50px; margin-bottom: 40px; background-color: yellow; } + div.box2 { background-color: aqua; float: left; width: 20px; height: 20px; } + div.box3 { clear: left; margin-top: 50px; height: 50px; background-color: orange; } + </style> + </head> + <body> + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="box1">A</div> + <div class="box2">B</div> + <div class="box3">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-005.xht new file mode 100644 index 0000000..d686922 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-005.xht
@@ -0,0 +1,104 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="may" /> + <style type="text/css"> + .target1, .target2, .target3, .target4, .target5, .target6, .target7 + { + position: absolute; + width: 0; + } + .target1, .target2, .target3, .target4 + { + left: -155px; + } + .target5, .target6, .target7 + { + left: 155px; + } + .target1, .target5 + { + border-left: 150px solid yellow; + height: 50px; + top: 0px; + } + .target2, .target6 + { + border-left: 20px solid aqua; + border-right: 130px solid silver; + height: 20px; + top: 50px; + } + .target3, .target7 + { + border-left: 140px solid orange; + border-right: 10px solid silver; + height: 50px; + top: 100px; + } + .target4 + { + border-left: 150px solid silver; + height: 30px; + top: 70px; + } + .target7 + { + top: 70px; + } + .container + { + border: solid thin; + margin-left: 150px; + position: relative; + width: 150px; + } + .box1 + { + background-color: yellow; + height: 50px; + } + .parentof2and3 + { + background-color: silver; + padding-right: 10px; + } + .box2 + { + background-color: aqua; + float: left; + height: 20px; + width: 20px; + } + .box3 + { + background-color: orange; + clear: left; + height: 50px; + margin-top: 50px; + } + </style> + </head> + <body> + <p>Test passes if the layout of the boxes within the black box matches either the left or the right reference boxes.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="target4"></div> + <div class="target5"></div> + <div class="target6"></div> + <div class="target7"></div> + <div class="box1"></div> + <div class="parentof2and3"> + <div class="box2"></div> + <div class="box3"></div> + </div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht new file mode 100644 index 0000000..f8709d9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"/> + <link rel="match" href="margin-collapse-clear-002-ref.xht" /> + + <style type="text/css"> + div.target1 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid yellow; top: 0px; } + div.target2 { position: absolute; left: -15px; height: 20px; width: 0; border-left: 5px solid aqua; top: 50px; } + div.target3 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid orange; top: 100px; } + div.container { width: 150px; position: relative; margin-left: 20px; border: solid thin; } + div.box1 { height: 50px; background-color: yellow; } + div.box2 { background-color: aqua; float: left; width: 20px; height: 20px; } + div.box3 { overflow: hidden; clear: left; margin-top: 50px; height: 50px; background-color: orange; } + </style> + </head> + <body> + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="box1">A</div> + <div class="box2">B</div> + <div class="box3">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-009.xht new file mode 100644 index 0000000..621d968 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-009.xht
@@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"/> + <link rel="match" href="margin-collapse-clear-003-ref.xht" /> + + <style type="text/css"> + div.target1 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid yellow; top: 0px; } + div.target2 { position: absolute; left: -15px; height: 20px; width: 0; border-left: 5px solid aqua; top: 90px; } + div.target3 { position: absolute; left: -15px; height: 50px; width: 0; border-left: 10px solid orange; top: 110px; } + div.container { width: 150px; position: relative; margin-left: 20px; border: solid thin; } + div.box1 { height: 50px; margin-bottom: 40px; background-color: yellow; } + div.box2 { background-color: aqua; float: left; width: 20px; height: 20px; } + div.box3 { overflow: hidden; clear: left; margin-top: 50px; height: 50px; background-color: orange; } + </style> + </head> + <body> + <p>The coloured bars on the left should match the coloured boxes in the black box.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="box1">A</div> + <div class="box2">B</div> + <div class="box3">C</div> + </div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-011.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-011.xht new file mode 100644 index 0000000..e61a6668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-011.xht
@@ -0,0 +1,105 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Margin Collapsing with Clearance</title> + <link rel="author" title="Microsoft" href="http://microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> + <meta name="flags" content="may" /> + <style type="text/css"> + .target1, .target2, .target3, .target4, .target5, .target6, .target7 + { + position: absolute; + width: 0; + } + .target1, .target2, .target3, .target4 + { + left: -155px; + } + .target5, .target6, .target7 + { + left: 155px; + } + .target1, .target5 + { + border-left: 150px solid yellow; + height: 50px; + top: 0px; + } + .target2, .target6 + { + border-left: 20px solid aqua; + border-right: 130px solid silver; + height: 20px; + top: 50px; + } + .target3, .target7 + { + border-left: 140px solid orange; + border-right: 10px solid silver; + height: 50px; + top: 100px; + } + .target4 + { + border-left: 150px solid silver; + height: 30px; + top: 70px; + } + .target7 + { + top: 70px; + } + .container + { + border: solid thin; + margin-left: 150px; + position: relative; + width: 150px; + } + .box1 + { + background-color: yellow; + height: 50px; + } + .parentof2and3 + { + background-color: silver; + padding-right: 10px; + } + .box2 + { + background-color: aqua; + float: left; + height: 20px; + width: 20px; + } + .box3 + { + background-color: orange; + clear: left; + height: 50px; + margin-top: 50px; + overflow: hidden; + } + </style> + </head> + <body> + <p>Test passes if the layout of the boxes within the black box matches either the left or the right reference boxes.</p> + <div class="container"> + <div class="target1"></div> + <div class="target2"></div> + <div class="target3"></div> + <div class="target4"></div> + <div class="target5"></div> + <div class="target6"></div> + <div class="target7"></div> + <div class="box1"></div> + <div class="parentof2and3"> + <div class="box2"></div> + <div class="box3"></div> + </div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012-ref.xht new file mode 100644 index 0000000..b8ced2a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012-ref.xht
@@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + + <style type="text/css"><![CDATA[ + div#lime + { + background-color: lime; + border-top: black solid 1px; + height: 200px; + width: 50%; + } + + div#yellow + { + background-color: yellow; + height: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled" /></div> + + <div id="yellow"></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012.xht new file mode 100644 index 0000000..9908d82 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012.xht
@@ -0,0 +1,128 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing with clearance - margins of a 'collapsed through' box with clearance do not collapse with parent block's bottom margin</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + <link rel="match" href="margin-collapse-clear-012-ref.xht" /> + + <meta content="When an element has had clearance applied to it and its own margins collapse, these margins collapse with the adjoining margins of following siblings but the resulting margin does not collapse with the bottom margin of the parent block" name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + #rel-pos-wrapper {position: relative;} + + #parent-lime + { + background-color: lime; + border-top: black solid 1px; + width: 50%; + } + + #float-left-blue + { + background-color: blue; + float: left; + height: 100px; + width: 100px; + } + + #clear-left + { + clear: left; + margin-bottom: 80px; + margin-top: 40px; + } + + #following-sibling {margin-bottom: 140px;} + + #next-yellow + { + background-color: yellow; + height: 100px; + } + + .ref-overlapped-red + { + background-color: red; + position: absolute; + z-index: -1; + } + + #ref1 + { + height: 200px; + top: 1px; + width: 50%; + } + + #ref2 + { + height: 100px; + top: 201px; + width: 100%; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="rel-pos-wrapper"> + + <!-- + + #parent-lime should have height 200px, sum of: + + 100px : height of #float-left-blue + + + (140px - 40px) : part of #following-sibling's margin-bottom + "exceeding" the amount collapsed with + #clear-left's margin-top (140px - 40px) + ======= + 200px + + --> + + <div id="parent-lime"> + <div id="float-left-blue"></div> + <div id="clear-left"></div> + + <!-- + + clearance + + + margin-top of #clear-left (40px) + ==================================== + height of #float-left-blue (100px) + + therefore, clearance is equal to +60px + + --> + + <div id="following-sibling"></div> + </div> + + <div id="next-yellow"></div> + + <!-- + #ref1 and #ref2 boxes create a sort of 'reference rendering' + where #ref1 should be covered, overlapped by #parent-lime + while #ref2 should be covered, overlapped by #next-yellow. + --> + + <div id="ref1" class="ref-overlapped-red"></div> + <div id="ref2" class="ref-overlapped-red"></div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht new file mode 100644 index 0000000..f55603ce9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht
@@ -0,0 +1,138 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing with clearance - margins of a 'collapsed through' box with clearance do not collapse with parent block's bottom margin</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block" /> + <link rel="bookmark" href="http://lists.w3.org/Archives/Public/public-css-testsuite/2013Oct/0009.html" title="Issue with margin-collapse-clear-012.htm and margin-collapse-clear-013.htm" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + <link rel="match" href="margin-collapse-clear-012-ref.xht" /> + + <meta content="When an element has had clearance applied to it and its own margins collapse, these margins do not collapse with the bottom margin of the parent block" name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + #rel-pos-wrapper {position: relative;} + + #parent-lime + { + background-color: lime; + border-top: black solid 1px; + width: 50%; + } + + #float-left-blue + { + background-color: blue; + float: left; + height: 100px; + width: 100px; + } + + #clear-left + { + clear: left; + margin-bottom: 140px; + margin-top: 40px; + } + + #next-yellow + { + background-color: yellow; + height: 100px; + } + + .ref-overlapped-red + { + background-color: red; + position: absolute; + z-index: -1; + } + + #ref1 + { + height: 200px; + top: 1px; + width: 50%; + } + + #ref2 + { + height: 100px; + top: 201px; + width: 100%; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="rel-pos-wrapper"> + + <!-- + + clearance + + + margin-top of #clear-left (40px) + ==================================== + height of #float-left-blue (100px) + + therefore, clearance is equal to +60px + + --> + + <!-- + + #parent-lime should have height 200px, sum of: + + 100px : height of #float-left-blue + + + (140px - 40px) : part of #clear-left's margin-bottom + exceeding #clear-left's margin-top + ======= + 200px + + The position of the top border edge of the div#clear-left + is where it would have been if the element had a + non-zero bottom border. The margins of div#clear-left + collapse together to 140px and the top border edge of + div#clear-left is at 40px inside of it. Clearance is + added at such position, not to the whole 140px. + + Issue with margin-collapse-clear-012.htm and margin-collapse-clear-013.htm + http://lists.w3.org/Archives/Public/public-css-testsuite/2013Oct/0012.html + + --> + + <div id="parent-lime"> + <div id="float-left-blue"></div> + <div id="clear-left"></div> + </div> + + <!-- + #next-yellow should immediately follow #parent-lime (no margins in between) + --> + + <div id="next-yellow"></div> + + <!-- + #ref1 and #ref2 boxes create a sort of 'reference rendering' + where #ref1 should be covered, overlapped by #parent-lime + while #ref2 should be covered, overlapped by #next-yellow. + --> + + <div id="ref1" class="ref-overlapped-red"></div> + <div id="ref2" class="ref-overlapped-red"></div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014-ref.xht new file mode 100644 index 0000000..f48ba9f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014-ref.xht
@@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + + <style type="text/css"><![CDATA[ + div#aqua + { + background-color: aqua; + height: 60px; + width: 50%; + } + + div#lime + { + background-color: lime; + line-height: 140px; + width: 50%; + } + + img {vertical-align: bottom;} + + div#yellow + { + background-color: yellow; + height: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="aqua"></div> + + <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled" /></div> + + <div id="yellow"></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht new file mode 100644 index 0000000..b2c5074f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht
@@ -0,0 +1,130 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing with clearance - clearance may be negative</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + <link rel="match" href="margin-collapse-clear-014-ref.xht" /> + + <meta content="Clearance is created above the top margin of the element with clear set. Clearance can be negative. Clearance stops the collapsing of the element's margins with the preceding siblings' margins and with the parent block's bottom margin." name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + #rel-pos-wrapper {position: relative;} + + #parent-lime + { + background-color: lime; + width: 50%; + } + + #preceding-sibling-aqua + { + background-color: aqua; + height: 60px; + margin-bottom: 40px; + } + + #float-left-blue + { + background-color: blue; + float: left; + height: 100px; + width: 100px; + } + + #clear-left + { + clear: left; + margin-top: 120px; + } + + #next-yellow + { + background-color: yellow; + height: 100px; + } + + .ref-overlapped-red + { + background-color: red; + position: absolute; + z-index: -1; + } + + #ref1 + { + height: 200px; + top: 0px; + width: 50%; + } + + #ref2 + { + height: 100px; + top: 200px; + width: 100%; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="rel-pos-wrapper"> + + <!-- + + #parent-lime should have height 200px, sum of: + + 60px : height of #preceding-sibling-aqua + + + 40px : margin-bottom of #preceding-sibling-aqua + + + 100px : height of #float-left-blue + ===================================================== + 200px + + --> + + <div id="parent-lime"> + <div id="preceding-sibling-aqua"></div> + <div id="float-left-blue"></div> + <div id="clear-left"></div> + </div> + + <!-- + + clearance + + + margin-top of #clear-left (120px) + ==================================== + height of #float-left-blue (100px) + + therefore, clearance is equal to -20px + + --> + + <div id="next-yellow"></div> + + <!-- + #ref1 and #ref2 boxes create a sort of 'reference rendering' + where #ref1 should be covered, overlapped by #parent-lime + while #ref2 should be covered, overlapped by #next-yellow. + --> + + <div id="ref1" class="ref-overlapped-red"></div> + <div id="ref2" class="ref-overlapped-red"></div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015-ref.xht new file mode 100644 index 0000000..860e38e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015-ref.xht
@@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + + <style type="text/css"><![CDATA[ + div#lime + { + background-color: lime; + border-top: black solid 1px; + height: 140px; + width: 50%; + } + + div#aqua + { + background-color: aqua; + height: 60px; + width: 50%; + } + + div#yellow + { + background-color: yellow; + height: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled" /></div> + + <div id="aqua"></div> + + <div id="yellow"></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015.xht new file mode 100644 index 0000000..0c18a3c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-015.xht
@@ -0,0 +1,102 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing with clearance - Margins collapsing of an element's top margin with its first in-flow child should not be affected by clear and clearance</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com" /> + <link rel="match" href="margin-collapse-clear-015-ref.xht" /> + + <meta content="When an element with clear set to it (to other than 'none') has a first in-flow child and their top margins are adjoining, then these margins should collapse normally." name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + #rel-pos-wrapper {position: relative;} + + #parent-lime + { + background-color: lime; + border-top: black solid 1px; + width: 50%; + } + + #float-left-blue + { + background-color: blue; + float: left; + height: 100px; + width: 100px; + } + + #clear-left {clear: left;} + + #clear-left > div + { + background-color: aqua; + height: 60px; + margin-top: 140px; + } + + #next-yellow + { + background-color: yellow; + height: 100px; + } + + .ref-overlapped-red + { + background-color: red; + left: 0; + position: absolute; + z-index: -1; + } + + #ref1 + { + height: 200px; + top: 1px; + width: 50%; + } + + #ref2 + { + height: 100px; + top: 201px; + width: 100%; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is <strong>no red</strong>.</p> + + <div id="rel-pos-wrapper"> + + <div id="parent-lime"> + <div id="float-left-blue"></div> + <div id="clear-left"> + <div></div> + </div> + </div> + + <div id="next-yellow"></div> + + <!-- + #ref1 and #ref2 boxes create a sort of 'reference rendering' + where #ref1 should be covered, overlapped by #parent-lime + while #ref2 should be covered, overlapped by #next-yellow. + --> + + <div id="ref1" class="ref-overlapped-red"></div> + <div id="ref2" class="ref-overlapped-red"></div> + + </div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016-ref.xht new file mode 100644 index 0000000..151143c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016-ref.xht
@@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + + <style type="text/css"><![CDATA[ + div + { + background-color: green; + height: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a wide filled green rectangle and <strong>no red</strong>.</p> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016.xht new file mode 100644 index 0000000..543670c4e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-016.xht
@@ -0,0 +1,60 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box without clearance can collapse with parent block's bottom margin</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="match" href="margin-collapse-clear-016-ref.xht" /> + + <meta content="An element that does not have clearance applied to it can collapse its top margin with its parent block's bottom margin. Margins of a 'collapsed through' box without clearance applied to it can collapse with its parent block's bottom margin. An element with clear set to it (to other than 'none') can only create a clearance if and when there is a preceding floated block." name="assert" /> + <meta content="" name="flags" /> + + <style type="text/css"><![CDATA[ + body + { + background-color: white; + } + + #parent-block + { + background-color: red; + margin-bottom: 0px; + } + + #sibling + { + background-color: green; + height: 100px; + } + + #element-without-clearance-applied + { + clear: both; + margin-top: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a wide filled green rectangle and <strong>no red</strong>.</p> + + <div id="parent-block"> + <div id="sibling"></div> + <div id="element-without-clearance-applied"></div> + </div> + + <!-- + #element-without-clearance-applied's margin-top collapses + with #parent-block's margin-bottom: the resulting margin-bottom + then collapses with the adjoining white body's margin-bottom + --> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017-ref.xht new file mode 100644 index 0000000..5c3f795 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017-ref.xht
@@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Reftest Reference</title> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + + <style type="text/css"><![CDATA[ + body + { + background: white url("support/ruler-v-100px-200px-300px.png") no-repeat; + margin: 34px 8px 8px 55px; + } + + p + { + font-size: 16px; + line-height: 20px; + margin: 1em 8px; + } + + div + { + background-color: green; + height: 10px; + margin-bottom: 100px; + } + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a vertical gap<br /> + of exactly 100px between 2 green bars.</p> + + <div></div> + + <div></div> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017.xht new file mode 100644 index 0000000..6e0dbf0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-017.xht
@@ -0,0 +1,82 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + + <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box without clearance can collapse with parent block's bottom margin</title> + + <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> + <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@gmx.de" /> + <link rel="match" href="margin-collapse-clear-017-ref.xht" /> + + <meta content="An element that does not have clearance applied to it can collapse its top margin with its parent block's bottom margin. Margins of a 'collapsed through' box without clearance applied to it can collapse with its parent block's bottom margin. An element with 'clear' set to a value other than 'none' can create a clearance only if and only when there is an earlier (in the source document) floating box." name="assert" /> + <meta content="image" name="flags" /> + + <style type="text/css"><![CDATA[ + body + { + background: white url("support/ruler-v-100px-200px-300px.png") no-repeat; + margin: 34px 8px 8px 55px; + /* + 34px : body's top margin collapsing with p's top margin: max(34px, 16px) + + 20px : p's 1st line box height + + 20px : p's 2nd line box height + + 16px : p's bottom margin + + 10px : height of topmost green bar + ====== + 100px + */ + } + + p + { + font-size: 16px; + line-height: 20px; + margin: 1em 8px; + } + + div#parent-block {margin-bottom: 100px;} + + div.vertical-gap-separator + { + background-color: green; + height: 10px; + } + + div#element-without-clearance + { + clear: both; + margin-top: 100px; + } + + /* + In this test, div#element-without-clearance + is what the spec refers to as + 'collapsed through' box + http://www.w3.org/TR/CSS21/box.html#collapsed-through + */ + ]]></style> + + </head> + + <body> + + <p>Test passes if there is a vertical gap<br /> + of exactly 100px between 2 green bars.</p> + + <div id="parent-block"> + <div class="vertical-gap-separator"></div> + <div id="element-without-clearance"></div> + </div> + + <div class="vertical-gap-separator"></div> + + <!-- + div#element-without-clearance's margin-top should collapse + with #parent-block's margin-bottom: max(100px, 100px) = 100px + --> + + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-green.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-green.png new file mode 100644 index 0000000..b98ca0ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-green.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-lime.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-lime.png new file mode 100644 index 0000000..cb397fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-lime.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-maroon.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-maroon.png new file mode 100644 index 0000000..3f86b07 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-maroon.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-navy.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-navy.png new file mode 100644 index 0000000..9b9a0395 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-navy.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-red.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-red.png new file mode 100644 index 0000000..6bd73ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-red.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-white.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-white.png new file mode 100644 index 0000000..dd43fae --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/1x1-white.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-gg-rr.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-gg-rr.png new file mode 100644 index 0000000..84f5b2a4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-gg-rr.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-green.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-green.png new file mode 100644 index 0000000..b3c8cf3eb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-green.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-red.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-red.png new file mode 100644 index 0000000..823f125 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/60x60-red.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/a-green.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/a-green.css new file mode 100644 index 0000000..b0dbb07 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/a-green.css
@@ -0,0 +1 @@ +.a { color: green; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/b-green.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/b-green.css new file mode 100644 index 0000000..a0473f5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/b-green.css
@@ -0,0 +1 @@ +.b { color: green; } \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/black15x15.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/black15x15.png new file mode 100644 index 0000000..b1bbef2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/black15x15.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/blue15x15.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/blue15x15.png new file mode 100644 index 0000000..89de32f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/blue15x15.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/c-red.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/c-red.css new file mode 100644 index 0000000..d4ba5c6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/c-red.css
@@ -0,0 +1 @@ +.c { color: red; } \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/cat.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/cat.png new file mode 100644 index 0000000..85dd732 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/cat.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-001.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-001.png new file mode 100644 index 0000000..b7e6634e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-001.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-002.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-002.png new file mode 100644 index 0000000..8085fe71 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-002.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-003.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-003.png new file mode 100644 index 0000000..18a3a8f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/clear-clearance-calculation-003.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/diamond.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/diamond.png new file mode 100644 index 0000000..51112ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/diamond.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/floats-005.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/floats-005.png new file mode 100644 index 0000000..c72bcba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/floats-005.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green-rectangle-50wideBy10tall.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green-rectangle-50wideBy10tall.png new file mode 100644 index 0000000..9f43666ee --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green-rectangle-50wideBy10tall.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green15x15.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green15x15.png new file mode 100644 index 0000000..5174158 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/green15x15.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-2em-space.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-2em-space.png new file mode 100644 index 0000000..2c381ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-2em-space.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-4em-space.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-4em-space.png new file mode 100644 index 0000000..dc338c0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/margin-collapse-4em-space.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rgr-grg.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rgr-grg.png new file mode 100644 index 0000000..9b88fbd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rgr-grg.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rrg-rgg.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rrg-rgg.png new file mode 100644 index 0000000..fcf4f3f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-grg-rrg-rgg.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-rgr-grg-rgr.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-rgr-grg-rgr.png new file mode 100644 index 0000000..d454e3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-rgr-grg-rgr.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-tr.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-tr.png new file mode 100644 index 0000000..8b4b253 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/pattern-tr.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ring.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ring.png new file mode 100644 index 0000000..061bb94 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ring.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ruler-v-100px-200px-300px.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ruler-v-100px-200px-300px.png new file mode 100644 index 0000000..d61da4d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/ruler-v-100px-200px-300px.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-purple.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-purple.png new file mode 100644 index 0000000..0f522d7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-purple.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-teal.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-teal.png new file mode 100644 index 0000000..e567f51 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-teal.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-white.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-white.png new file mode 100644 index 0000000..5853cbb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/square-white.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-blue.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-blue.png new file mode 100644 index 0000000..bf27596 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-blue.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-green.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-green.png new file mode 100644 index 0000000..0aa79b0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-green.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-lime.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-lime.png new file mode 100644 index 0000000..55fd7fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-lime.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-orange.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-orange.png new file mode 100644 index 0000000..d3cd498b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-orange.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-purple.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-purple.png new file mode 100644 index 0000000..73bea77 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-purple.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-red.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-red.png new file mode 100644 index 0000000..1caf25c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-red.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-white.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-white.png new file mode 100644 index 0000000..1a7d4323 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-white.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-yellow.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-yellow.png new file mode 100644 index 0000000..1591aa0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/swatch-yellow.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-bl.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-bl.png new file mode 100644 index 0000000..904e24e9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-bl.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-br.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-br.png new file mode 100644 index 0000000..f413ff5c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-br.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-outer.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-outer.png new file mode 100644 index 0000000..82eeace7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-outer.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tl.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tl.png new file mode 100644 index 0000000..f6ac0ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tl.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tr.png b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tr.png new file mode 100644 index 0000000..59843ae5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats-clear/support/test-tr.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference-expected.txt new file mode 100644 index 0000000..d5bf8065 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS Longhand with variable preserves original serialization: with withespace +FAIL Shorthand with variable preserves original serialization: with withespace assert_equals: expected "font: var(--a);" but got "font-style: ; font-variant: var(--a); font-weight: ; font-stretch: ; font-size: ; line-height: ; font-family: ;" +FAIL Longhand with variable preserves original serialization: without withespace assert_equals: expected "font-size:var(--a);" but got "font-size: var(--a);" +FAIL Shorthand with variable preserves original serialization: without withespace assert_equals: expected "font:var(--a);" but got "font-style: ; font-variant: var(--a); font-weight: ; font-stretch: ; font-size: ; line-height: ; font-family: ;" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference.html b/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference.html new file mode 100644 index 0000000..d714b815 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cssom/serialize-variable-reference.html
@@ -0,0 +1,34 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSOM - Serialization with variable preserves original serialization.</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="longhand-whitespace" style="font-size: var(--a);"></div> +<div id="shorthand-whitespace" style="font: var(--a);"></div> +<div id="longhand" style="font-size:var(--a);"></div> +<div id="shorthand" style="font:var(--a);"></div> +<script> + test(function() { + var elem = document.getElementById('longhand-whitespace'); + + assert_equals(elem.style.cssText, 'font-size: var(--a);'); + }, 'Longhand with variable preserves original serialization: with withespace') + + test(function() { + var elem = document.getElementById('shorthand-whitespace'); + + assert_equals(elem.style.cssText, 'font: var(--a);'); + }, 'Shorthand with variable preserves original serialization: with withespace') + + test(function() { + var elem = document.getElementById('longhand'); + + assert_equals(elem.style.cssText, 'font-size:var(--a);'); + }, 'Longhand with variable preserves original serialization: without withespace') + + test(function() { + var elem = document.getElementById('shorthand'); + + assert_equals(elem.style.cssText, 'font:var(--a);'); + }, 'Shorthand with variable preserves original serialization: without withespace') +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html b/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html index a969c80..85a4b0a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html
@@ -43,7 +43,7 @@ assert_unreached("listener of " + legacyType + " should not be invoked again"); return; } - elem.dispatchEvent(new ctor(type)); + elem.dispatchEvent(new window[ctor](type)); t.done(); })); setup(elem); @@ -65,8 +65,8 @@ elem.style.animation = 'test 30ms 2'; } -runLegacyEventTest('transitionend', 'webkitTransitionEnd', TransitionEvent, setupTransition); -runLegacyEventTest('animationend', 'webkitAnimationEnd', AnimationEvent, setupAnimation); -runLegacyEventTest('animationiteration', 'webkitAnimationIteration', AnimationEvent, setupAnimation); -runLegacyEventTest('animationstart', 'webkitAnimationStart', AnimationEvent, setupAnimation); +runLegacyEventTest('transitionend', 'webkitTransitionEnd', "TransitionEvent", setupTransition); +runLegacyEventTest('animationend', 'webkitAnimationEnd', "AnimationEvent", setupAnimation); +runLegacyEventTest('animationiteration', 'webkitAnimationIteration', "AnimationEvent", setupAnimation); +runLegacyEventTest('animationstart', 'webkitAnimationStart', "AnimationEvent", setupAnimation); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/block-mime-as-script.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/block-mime-as-script.html new file mode 100644 index 0000000..37c3883 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/block-mime-as-script.html
@@ -0,0 +1,39 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Block mime type as script</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div></div> +<script> + var noop = function() {}; + + ["text/csv", + "audio/aiff", + "audio/midi", + "audio/whatever", + "video/avi", + "video/fli", + "video/whatever", + "image/jpeg", + "image/gif", + "image/whatever"].forEach(function(test_case) { + async_test(function(t) { + var script = document.createElement("script"); + script.onerror = t.step_func_done(noop); + script.onload = t.unreached_func("Unexpected load event"); + script.src = "../resources/script-with-header.py?mime=" + test_case; + document.body.appendChild(script); + }, "Should fail loading script with " + test_case + " MIME type"); + }); + + ["html", "plain"].forEach(function(test_case) { + async_test(function(t) { + var script = document.createElement("script"); + script.onerror = t.unreached_func("Unexpected error event"); + script.onload = t.step_func_done(noop); + script.src = "../resources/script-with-header.py?mime=text/" + test_case; + document.body.appendChild(script); + }, "Should load script with text/" + test_case + " MIME type"); + }); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error-expected.txt index 20a41722..9c18579 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error-expected.txt
@@ -2,6 +2,7 @@ FAIL RequestInit's window is not null assert_throws: Expect TypeError exception function "function () { new Request("", {"window" : "http://test.url"}); }" did not throw PASS Input URL is not valid PASS Input URL has credentials +PASS RequestInit's mode is navigate PASS RequestInit's referrer is invalid PASS RequestInit's method is invalid PASS RequestInit's method is forbidden
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error.html index 0339ae1..a04bfde 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-error.html
@@ -27,6 +27,11 @@ },"Input URL has credentials"); test(function() { + assert_throws(new TypeError() , function() { new Request("", {"mode" : "navigate"}); }, + "Expect TypeError exception"); + },"RequestInit's mode is navigate"); + + test(function() { assert_throws(new TypeError() , function() { new Request("", {"referrer" : "http://:not a valid URL"}); }, "Expect TypeError exception"); },"RequestInit's referrer is invalid");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub-expected.txt index 445eebe..5c099bf 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub-expected.txt
@@ -24,7 +24,6 @@ PASS Check mode init value of same-origin and associated getter PASS Check mode init value of no-cors and associated getter PASS Check mode init value of cors and associated getter -FAIL Check mode init value of navigate and associated getter Failed to construct 'Request': Cannot construct a Request with a RequestInit whose mode member is set as 'navigate'. PASS Check credentials init value of omit and associated getter PASS Check credentials init value of same-origin and associated getter PASS Check credentials init value of include and associated getter
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub.html index 9383b435..ea302d6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub.html
@@ -49,8 +49,8 @@ "strict-origin-when-cross-origin" ] }; - var modes = {"givenValues" : ["same-origin", "no-cors", "cors", "navigate"], - "expectedValues" : ["same-origin", "no-cors", "cors", "same-origin"] + var modes = {"givenValues" : ["same-origin", "no-cors", "cors"], + "expectedValues" : ["same-origin", "no-cors", "cors"] }; var credentials = {"givenValues" : ["omit", "same-origin", "include"], "expectedValues" : ["omit", "same-origin", "include"]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/script-with-header.py b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/script-with-header.py new file mode 100644 index 0000000..778871b4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/script-with-header.py
@@ -0,0 +1,4 @@ +def main(request, response): + headers = [("Content-type", request.GET.first("mime"))] + content = "console.log('Script loaded')" + return 200, headers, content
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter-expected.txt new file mode 100644 index 0000000..07efd13 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +PASS failed setting of document.domain +FAIL same-origin-domain iframe Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://web-platform.test:8001" from accessing a cross-origin frame. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html new file mode 100644 index 0000000..bf5b0bc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html
@@ -0,0 +1,68 @@ +<!doctype html> +<html> + <head> + <title></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + </head> + <body> + <iframe id="iframe"></iframe> + <script> + var host_info = get_host_info(); + var HTTP_PORT = host_info.HTTP_PORT; + var ORIGINAL_HOST = host_info.ORIGINAL_HOST; // e.g. "web-platform.test" + var SUFFIX_HOST = ORIGINAL_HOST.substring(ORIGINAL_HOST.lastIndexOf('.') + 1); // e.g. "test" + var PREFIX_HOST = "www1." + ORIGINAL_HOST; // e.g. "www1.web-platform.test" + var iframe = document.getElementById("iframe"); + var iframe_url = new URL("document_domain_setter_iframe.html", document.location); + iframe_url.hostname = PREFIX_HOST; + iframe.src = iframe_url; + test(function() { + assert_throws("SecurityError", function() { document.domain = SUFFIX_HOST; }); + assert_throws("SecurityError", function() { document.domain = "." + SUFFIX_HOST; }); + assert_throws("SecurityError", function() { document.domain = PREFIX_HOST; }); + assert_throws("SecurityError", function() { document.domain = "example.com"; }); + }, "failed setting of document.domain"); + async_test(function(t) { + iframe.addEventListener("load", t.step_func(function() { + // Before setting document.domain, the iframe is not + // same-origin-domain, so security checks fail. + assert_equals(iframe.contentDocument, null); + assert_equals(iframe.contentWindow.frameElement, null); + assert_throws("SecurityError", function() { iframe.contentWindow.location.origin; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.href; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.protocol; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.host; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.port; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.hostname; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.pathname; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.hash; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.search; }); + assert_throws("SecurityError", function() { iframe.contentWindow.location.toString(); }); + // Set document.domain + document.domain = ORIGINAL_HOST; + // After setting document.domain, the iframe is + // same-origin-domain, so security checks pass. + assert_equals(iframe.contentDocument.domain, document.domain); + assert_equals(iframe.contentWindow.frameElement, iframe) + assert_equals(iframe.contentWindow.origin, window.origin); + assert_equals(iframe.contentWindow.location.href, iframe_url.href); + assert_equals(iframe.contentWindow.location.protocol, iframe_url.protocol); + assert_equals(iframe.contentWindow.location.host, iframe_url.host); + assert_equals(iframe.contentWindow.location.port, iframe_url.port); + assert_equals(iframe.contentWindow.location.hostname, iframe_url.hostname); + assert_equals(iframe.contentWindow.location.pathname, iframe_url.pathname); + assert_equals(iframe.contentWindow.location.hash, iframe_url.hash); + assert_equals(iframe.contentWindow.location.search, iframe_url.search); + assert_equals(iframe.contentWindow.location.search, iframe_url.search); + assert_equals(iframe.contentWindow.location.toString(), iframe_url.toString()); + // document.open checks for same-origin, not same-origin-domain, + // https://github.com/whatwg/html/issues/2282 + assert_throws("SecurityError", function() { iframe.contentDocument.open(); }); + t.done(); + })); + }, "same-origin-domain iframe"); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_iframe.html b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_iframe.html new file mode 100644 index 0000000..d3d5260 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_iframe.html
@@ -0,0 +1,12 @@ +<!doctype html> +<html> + <head> + <title></title> + <script src="/common/get-host-info.sub.js"></script> + <script> + document.domain = get_host_info().ORIGINAL_HOST; + </script> + </head> + <body> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html b/third_party/WebKit/LayoutTests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html new file mode 100644 index 0000000..6b1abf5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html
@@ -0,0 +1,35 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<title>Safe passing of structured data - Blob</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> +async_test(function(t) { + var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type:"text/plain"}); + window.addEventListener("message", this.step_func(function(msg) { + assert_true(msg.data instanceof Blob); + assert_equals(msg.data.size, blob.size); + assert_equals(msg.data.type, blob.type); + var cloned_content, original_content; + var reader = new FileReader(); + reader.addEventListener("loadend", this.step_func(function() { + original_content = reader.result; + var reader2 = new FileReader(); + reader2.addEventListener("loadend", this.step_func_done(function() { + cloned_content = reader2.result; + assert_equals(typeof cloned_content, typeof original_content); + assert_equals(cloned_content, original_content); + })); + reader2.readAsText(msg.data); + })); + reader.readAsText(blob); + }), false); + window.postMessage(blob, '*'); +}, "Cloning a Blob into the same realm"); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/bad.css b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/bad.css new file mode 100644 index 0000000..4e1fe361 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/bad.css
@@ -0,0 +1,4 @@ +p { + background-color: red; + color: black; +} \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/good.css b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/good.css new file mode 100644 index 0000000..1da5e2b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/good.css
@@ -0,0 +1,3 @@ +p { + color: green; +} \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html new file mode 100644 index 0000000..9ae6e366 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href-ref.html
@@ -0,0 +1,8 @@ +<!doctype html> +<meta charset="utf-8"> +<style> + p { + color: green; + } +</style> +<p>This text should be green on a white background
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html new file mode 100644 index 0000000..6a3f18d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html
@@ -0,0 +1,13 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Obtaining a new stylesheet removes styles from the previous stylesheet.</title> +<link rel=match href=stylesheet-change-href-ref.html> +<script> + function changeHref() { + var elem = document.getElementById('stylesheet'); + elem.href = 'resources/good.css'; + elem.onload = null; + } +</script> +<link id=stylesheet rel=stylesheet href="resources/bad.css" onload="changeHref()"> +<p>This text should be green on a white background
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_harness.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_harness.js index f4ef511..2b43c54 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_harness.js +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_harness.js
@@ -1,15 +1,16 @@ function get_test_results(id) { async_test(function(test) { - var timer = window.setInterval(test.step_func(loop), 100); + test.step_timeout(loop, 100); function loop() { var xhr = new XMLHttpRequest(); xhr.open('GET', 'stash.py?id=' + id); - xhr.onreadystatechange = test.step_func(function() { + xhr.onload = test.step_func(function() { assert_equals(xhr.status, 200); if (xhr.responseText) { assert_equals(xhr.responseText, "OK"); test.done(); - window.clearTimeout(timer); + } else { + test.step_timeout(loop, 100); } }); xhr.send();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/delay-load-event.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/delay-load-event.html new file mode 100644 index 0000000..c67074a4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/delay-load-event.html
@@ -0,0 +1,17 @@ +<html> +<head> +<title>Image element delays window's load event</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<img src="resources/cat.jpg?pipe=trickle(d2)"> +<script> + async_test(function(t) { + var saw_img_load = false; + document.querySelector('img').onload = t.step_func(function() { + saw_img_load = true; + }); + addEventListener('load', t.step_func_done(function() { + assert_true(saw_img_load); + })); + }); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html new file mode 100644 index 0000000..ea63114d5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html
@@ -0,0 +1,14 @@ +<!DOCTYPE HTML> +<meta charset="utf-8"> +<title>Document base URL adopted img test</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" /> +<link rel="match" href="document-base-url-ref.html"> +<base href="resources/" /> +<iframe></iframe> +<script> + var iframe = document.querySelector('iframe'); + var i = iframe.contentDocument.createElement('img'); + i.src = "cat.jpg"; + document.body.appendChild(i); + iframe.remove(); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_attribute.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_attribute.html new file mode 100644 index 0000000..dde3250d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_attribute.html
@@ -0,0 +1,233 @@ +<!DOCTYPE html> +<html> + <head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div> + <form id="f1"></form> + <form id="f2"> + <input id="i1" /> + <input id="i2" form="f1" /> + <input id="i3" /> + </form> + <script> + test(function() { + var i1 = document.getElementById("i1"); + var i2 = document.getElementById("i2"); + var i3 = document.getElementById("i3"); + var f1 = document.getElementById("f1"); + var f2 = document.getElementById("f2"); + + assert_equals(i1.form, f2, + "i1 must be associated with f2 by the parser"); + assert_equals(i2.form, f1, + "i2 is not associated with f2 by the parser " + + "since it has the form attribute set to f1"); + + f1.appendChild(i1); + i3.setAttribute("form", "f1"); + + assert_equals(i1.form, f1, + "i1's form owner must be reset when parent changes"); + assert_equals(i3.form, f1, + "i3's form owner must be reset when the form" + + "attribute is set"); + + assert_equals(i2.form, f1); + }, "Tests for parser inserted controls"); + </script> + </div> + + <div id="placeholder"> + </div> + + <script> + var reassociateableElements = [ + "button", + "fieldset", + "input", + "object", + "output", + "select", + "textarea", + ]; + + var form1 = null; + var form2 = null; + var placeholder = document.getElementById("placeholder"); + + reassociateableElements.forEach(function(localName) { + function testControl(test_, desc) { + test(function() { + var control = document.createElement(localName); + + while(placeholder.firstChild) + placeholder.removeChild(placeholder.firstChild); + + form1 = document.createElement("form"); + form2 = document.createElement("form"); + form1.id = "form1"; + form2.id = "form2"; + placeholder.appendChild(form1); + placeholder.appendChild(form2); + + test_.call(control); + }, "[" + localName.toUpperCase() + "] " + desc); + } + + testControl(function() { + form1.appendChild(this); + assert_equals(this.form, form1); + }, "Basic form association - control with no form attribute is associated with ancestor"); + + testControl(function() { + this.setAttribute("form", "form1"); + form1.appendChild(this); + assert_equals(this.form, form1); + + form1.id = "form-one"; + assert_equals(this.form, null); + }, "Form owner is reset to null when control's form attribute is set to an ID " + + "that does not exist in the document"); + + testControl(function() { + this.setAttribute("form", ""); + form1.appendChild(this); + assert_equals(this.form, null); + }, "Control whose form attribute is an empty string has no form owner"); + + testControl(function() { + form1.id = ""; + this.setAttribute("form", ""); + form1.appendChild(this); + assert_equals(this.form, null); + }, "Control whose form attribute is an empty string has no form owner " + + "even when form with empty attribute is present"); + + testControl(function() { + form1.id = "FORM1"; + this.setAttribute("form", "form1"); + form1.appendChild(this); + assert_equals(this.form, null); + }, "Control's form attribute must be a case sensitive match for the form's id"); + + testControl(function() { + form1.appendChild(this); + assert_equals(this.form, form1); + + this.setAttribute("form", "form2"); + assert_equals(this.form, form2); + }, "Setting the form attribute of a control to the id of a non-ancestor form works"); + + testControl(function() { + this.setAttribute("form", "form1"); + + form2.appendChild(this); + assert_equals(this.form, form1); + + this.removeAttribute("form"); + assert_equals(this.form, form2); + }, "Removing form id from a control resets the form owner to ancestor"); + + testControl(function() { + this.setAttribute("form", "form1"); + + form2.appendChild(this); + assert_equals(this.form, form1); + + placeholder.removeChild(form1); + + assert_equals(this.form, null); + }, "Removing the form owner of a control with form attribute resets " + + "the form owner to null"); + + testControl(function() { + var form3 = document.createElement("form"); + form3.id = "form3"; + placeholder.appendChild(form3); + form3.appendChild(this); + assert_equals(this.form, form3); + + this.setAttribute("form", "form2"); + assert_equals(this.form, form2); + + this.setAttribute("form", "form1"); + assert_equals(this.form, form1); + }, "Changing form attibute of control resets form owner to correct form"); + + testControl(function() { + this.setAttribute("form", "form1"); + var form3 = document.createElement("form"); + form3.id = "form3"; + + placeholder.appendChild(form3); + placeholder.appendChild(this); + assert_equals(this.form, form1); + + form1.appendChild(this); + assert_equals(this.form, form1); + + form2.appendChild(this); + assert_equals(this.form, form1); + }, "Moving a control with form attribute within the document " + + "does not change the form owner"); + + testControl(function() { + form1.id = "form-one"; + this.setAttribute("form", "form1"); + form2.appendChild(this); + assert_equals(this.form, null); + + form1.id = "form1"; + assert_equals(this.form, form1); + }, "When the id of a non-ancestor form changes from not being a match for the " + + "form attribute to being a match, the control's form owner is reset"); + + testControl(function() { + this.setAttribute("form", "form1"); + form1.appendChild(this); + assert_equals(this.form, form1); + + form2.id = "form1"; + form1.parentNode.insertBefore(form2, form1); + assert_equals(this.form, form2); + + form2.parentNode.removeChild(form2); + assert_equals(this.form, form1); + + form1.parentNode.appendChild(form2); + assert_equals(this.form, form1); + }, "When form element with same ID as the control's form attribute is inserted " + + "earlier in tree order, the form owner is changed to the inserted form"); + + testControl(function() { + this.setAttribute("form", "form1"); + form2.appendChild(this); + assert_equals(this.form, form1); + + var span = document.createElement("span"); + span.id = "form1"; + form1.parentNode.insertBefore(span, form1); + assert_equals(this.form, null); + + form1.parentNode.appendChild(span); + assert_equals(this.form, form1); + }, "When non-form element with same ID as the control's form attribute is " + + "inserted earlier in tree order, the control does not have a form owner"); + + testControl(function() { + this.setAttribute("form", "form1"); + form1.appendChild(this); + assert_equals(this.form, form1); + + form1.parentNode.removeChild(form1); + assert_equals(this.form, form1); + }, "A control that is not in the document but has the form attribute set " + + "is associated with the nearest ancestor form if one exists"); + + }); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table.html new file mode 100644 index 0000000..1aa75c2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table.html
@@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html> + <head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id="root"> + <form id='form1'></form> + <table id='table1'> + <form id='form2'> + <tr><td><input id='input1'></td></tr> + <tr><td><input id='input2' form='form1'></td></tr> + </table> + <form id="form3"> + <input id="input3" /> + </form> + </div> + + <script> + test(function() { + var input1 = document.getElementById('input1'); + var input2 = document.getElementById('input2'); + var input3 = document.getElementById('input3'); + var form1 = document.getElementById('form1'); + var form2 = document.getElementById('form2'); + var form3 = document.getElementById('form3'); + + var root = document.getElementById('root'); + + assert_equals(input1.form, form2, + "input1's form owner must be form2 as per the parsing rules"); + assert_equals(input2.form, form1, + "input2's form owner must be the form with id 'form1'"); + assert_equals(input3.form, form2, + "input3's form owner must be form2 as per the parsing rules"); + + root.parentNode.removeChild(root); + + assert_equals(input1.form, form2, + "input1's form owner must not have changed since they are both in the same subtree"); + assert_equals(input2.form, null, + "input2 must not have a form owner since it has the form attribute set"); + assert_equals(input3.form, form2, + "input3's form owner must not have changed since they are both in the same subtree"); + + }, "Form element and form controls nested inside a table are correctly handled"); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html new file mode 100644 index 0000000..d9aee12b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div> + <form id='form1'></form> + <table id='table1'> + <form id='form2'> + <script> + var t = document.getElementById('table1'); + var f = document.getElementById('form2'); + t.removeChild(f); + </script> + <tr><td><input id='input1'></td></tr> + <tr><td><input id='input2' form='form1'></td></tr> + </table> + <form id="form3"> + <input id="input3" /> + </form> + </div> + + <script> + test(function() { + var form1 = document.getElementById('form1'); + + assert_equals(document.getElementById('input1').form, null, + "input1's form owner must be null since form2 is not in the" + + "same home subtree"); + + assert_equals(document.getElementById('input2').form, form1, + "input2's form owner must be the form with id 'form1'"); + + assert_equals(document.getElementById('input3').form, null, + "input3's form owner must be null instead of form2 (as per parsing rules)" + + "since form2 is not in the same home subtree"); + + }, "Controls nested in tables are not associated with form element inside the " + + "table if the form had been removed by script before the controls were " + + "inserted by the parser"); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html new file mode 100644 index 0000000..8e47121 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-getter-01.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement.rel getter</title> +<link rel="author" title="TheKK" href="mailto:thumbd03803@gmail.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-rel"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<div> +<a id="test" href="a" rel="noreferrer"></a> +</div> +<script> +test(function() { + var a = document.getElementById("test"); + + test(function() { + assert_equals(a.rel, "noreferrer"); + }, "Test anchor's rel getter"); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html new file mode 100644 index 0000000..83c69de3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a.rel-setter-01.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement.rel setter</title> +<link rel="author" title="TheKK" href="mailto:thumbd03803@gmail.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-rel"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<div> +<a id="test" href="a"></a> +</div> +<script> +test(function() { + var a = document.getElementById("test"); + + test(function() { + a.rel = "noreferrer" + assert_equals(a.rel, "noreferrer"); + }, "Test anchor's rel setter"); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.dedicatedworker-expected.txt new file mode 100644 index 0000000..41e78c1b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.dedicatedworker-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL Floating point arithmetic must manifest near NUMBER.MAX_SAFE_INTEGER (total ends up positive) assert_equals: [[queueTotalSize]] must clamp to 0 if it becomes negative expected 0 but got 1 +FAIL Floating point arithmetic must manifest near 0 (total ends up positive, but clamped) assert_equals: [[queueTotalSize]] must clamp to 0 if it becomes negative expected 0 but got 1.1102230246251565e-16 +PASS Floating point arithmetic must manifest near 0 (total ends up positive, and not clamped) +PASS Floating point arithmetic must manifest near 0 (total ends up zero) +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.js b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.js index 3bb3b6a9..f7c7624 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/floating-point-total-queue-size.js
@@ -117,3 +117,5 @@ return { reader: rs.getReader(), controller }; } + +done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/floating-point-total-queue-size.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/floating-point-total-queue-size.js index 44cf5fb..932ac271 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/floating-point-total-queue-size.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/floating-point-total-queue-size.js
@@ -88,3 +88,5 @@ return ws.getWriter(); } + +done();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js index c31ae28..27539da 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -989,6 +989,7 @@ InspectorTest.debuggerModel = target.model(SDK.DebuggerModel); InspectorTest.runtimeModel = target.model(SDK.RuntimeModel); InspectorTest.domModel = target.model(SDK.DOMModel); + InspectorTest.domDebuggerModel = target.model(SDK.DOMDebuggerModel); InspectorTest.cssModel = target.model(SDK.CSSModel); InspectorTest.cpuProfilerModel = target.model(SDK.CPUProfilerModel); InspectorTest.serviceWorkerManager = target.model(SDK.ServiceWorkerManager);
diff --git a/third_party/WebKit/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners.html b/third_party/WebKit/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners.html index 183014f..f42ee60 100644 --- a/third_party/WebKit/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners.html +++ b/third_party/WebKit/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners.html
@@ -52,17 +52,17 @@ function testWindowEventListeners(next) { - windowObject.eventListeners().then(dumpListeners.bind(this, next)); + InspectorTest.domDebuggerModel.eventListeners(windowObject).then(dumpListeners.bind(this, next)); }, function testDivEventListeners(next) { - divWithHandlers.eventListeners().then(dumpListeners.bind(this, next)); + InspectorTest.domDebuggerModel.eventListeners(divWithHandlers).then(dumpListeners.bind(this, next)); }, function testDivWithoutEventListeners(next) { - divWithoutHandlers.eventListeners().then(dumpListeners.bind(this, next)); + InspectorTest.domDebuggerModel.eventListeners(divWithoutHandlers).then(dumpListeners.bind(this, next)); } ]); }
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png new file mode 100644 index 0000000..744ffd4b --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png new file mode 100644 index 0000000..744ffd4b --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html b/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html index fe5e714..b7ce1ce 100644 --- a/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html +++ b/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html
@@ -4,67 +4,136 @@ <title>Test AudioContextOptions</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> - <script src="resources/audio-testing.js"></script> + <script src="resources/audit.js"></script> </head> <body> <script> - var context; - var audit = Audit.createTaskRunner(); + let context; + let defaultLatency; + let interactiveLatency; + let balancedLatency; + let playbackLatency; - // Task: test AudioContextOptions (1). - audit.defineTask('test-audiocontextoptions-1', function (done) { + let audit = Audit.createTaskRunner(); - // Verify that an AudioContext can be created with default options. - Should("context = new AudioContext()", function () { - context = new AudioContext(); - }).notThrow(); + audit.define( + { + label : "test-audiocontextoptions-latencyHint-basic", + description : "Test creating contexts with basic latencyHint types." + }, + function(task, should) { + let closingPromises = []; - var defaultLatency = context.baseLatency; - Should("default baseLatency", defaultLatency).beGreaterThan(0); + // Verify that an AudioContext can be created with default options. + should(function(){context = new AudioContext()}, + "context = new AudioContext()") + .notThrow(); - // Verify that any double can be passed and that it results in interactive latency - Should("context = new AudioContext({'latencyHint': 0.05})", function () { - context = new AudioContext({'latencyHint': 0.05}); - }).notThrow(); - Should("double-constructor baseLatency", context.baseLatency).beEqualTo(defaultLatency); + defaultLatency = context.baseLatency; + should(defaultLatency, "default baseLatency").beGreaterThan(0); - // Verify that an AudioContext can be created with the expected latency types. - Should("context = new AudioContext({'latencyHint': 'interactive'})", function () { - context = new AudioContext({'latencyHint': 'interactive'}); - }).notThrow(); + // Verify that an AudioContext can be created with the expected + // latency types. + should(function(){context = new AudioContext( + {'latencyHint' : 'interactive'})}, + "context = new AudioContext({'latencyHint': 'interactive'})") + .notThrow(); - var interactiveLatency = context.baseLatency; - Should("interactive baseLatency", interactiveLatency).beEqualTo(defaultLatency); + interactiveLatency = context.baseLatency; + should(interactiveLatency, "interactive baseLatency") + .beEqualTo(defaultLatency); + closingPromises.push(context.close()); - Should("context = new AudioContext({'latencyHint': 'balanced'})", function () { - context = new AudioContext({'latencyHint': 'balanced'}); - }).notThrow(); + should(function(){context = + new AudioContext({'latencyHint' : 'balanced'})}, + "context = new AudioContext({'latencyHint': 'balanced'})") + .notThrow(); - var balancedLatency = context.baseLatency; - Should("balanced baseLatency", balancedLatency).beGreaterThanOrEqualTo(interactiveLatency); + balancedLatency = context.baseLatency; + should(balancedLatency, "balanced baseLatency") + .beGreaterThanOrEqualTo(interactiveLatency); + closingPromises.push(context.close()); - Should("context = new AudioContext({'latencyHint': 'playback'})", function () { - context = new AudioContext({'latencyHint': 'playback'}); - }).notThrow(); + should(function(){context = + new AudioContext({'latencyHint' : 'playback'})}, + "context = new AudioContext({'latencyHint': 'playback'})") + .notThrow(); - var playbackLatency = context.baseLatency; - Should("playback baseLatency", playbackLatency).beGreaterThanOrEqualTo(balancedLatency); + playbackLatency = context.baseLatency; + should(playbackLatency, "playback baseLatency") + .beGreaterThanOrEqualTo(balancedLatency); + closingPromises.push(context.close()); - // Verify that invalid latencyHint values are rejected. - Should("context = new AudioContext({'latencyHint': 'foo'})", function () { - context = new AudioContext({'latencyHint': 'foo'}); - }).throw("TypeError"); + Promise.all(closingPromises).then(function() { task.done(); }); + }); - // Verify that no extra options can be passed into the AudioContextOptions. - Should("context = new AudioContext('latencyHint')", function () { - context = new AudioContext('latencyHint'); - }).throw("TypeError"); + audit.define( + { + label : "test-audiocontextoptions-latencyHint-double", + description : + "Test creating contexts with explicit latencyHint values." + }, + function(task, should) { + var closingPromises = []; - done(); - }); + // Verify too small exact latency clamped to 'interactive' + should(function(){context = new AudioContext( + {'latencyHint' : interactiveLatency / 2})}, + "context = new AudioContext({'latencyHint': " + + "interactiveLatency/2})") + .notThrow(); + should(context.baseLatency, "double-constructor baseLatency small") + .beEqualTo(interactiveLatency); + closingPromises.push(context.close()); - audit.runTasks(); + // Verify that exact latency in range works as expected + var validLatency = (interactiveLatency + playbackLatency) / 2; + should(function(){context = new AudioContext( + {'latencyHint' : validLatency})}, + "context = new AudioContext({'latencyHint': validLatency})") + .notThrow(); + should(context.baseLatency, + "double-constructor baseLatency inrange 1") + .beGreaterThanOrEqualTo(interactiveLatency); + should(context.baseLatency, + "double-constructor baseLatency inrange 2") + .beLessThanOrEqualTo(playbackLatency); + closingPromises.push(context.close()); + + // Verify too big exact latency clamped to some value + var context1; + var context2; + should( + function() { + context1 = + new AudioContext({'latencyHint' : playbackLatency * 10}); + context2 = + new AudioContext({'latencyHint' : playbackLatency * 20}); + }, + "creating two high latency contexts") + .notThrow(); + should(context1.baseLatency, "high latency context baseLatency") + .beEqualTo(context2.baseLatency); + closingPromises.push(context1.close()); + closingPromises.push(context2.close()); + + // Verify that invalid latencyHint values are rejected. + should( + function(){context = new AudioContext({'latencyHint' : 'foo'})}, + "context = new AudioContext({'latencyHint': 'foo'})") + .throw("TypeError"); + + // Verify that no extra options can be passed into the + // AudioContextOptions. + should(function(){context = new AudioContext('latencyHint')}, + "context = new AudioContext('latencyHint')") + .throw("TypeError"); + + Promise.all(closingPromises).then(function() { task.done(); }); + }); + + audit.run(); </script> </body> </html>
diff --git a/third_party/WebKit/Source/config.gni b/third_party/WebKit/Source/config.gni index 8aab3e0..a8030224 100644 --- a/third_party/WebKit/Source/config.gni +++ b/third_party/WebKit/Source/config.gni
@@ -35,26 +35,14 @@ use_webaudio_ffmpeg = !is_mac && !is_android -# Set this to true to enable use of concatenated impulse responses for the HRTF -# panner in WebAudio. -# TODO(brettw) do we need this or can we assume its always on? -use_concatenated_impulse_responses = true - # feature_defines_list --------------------------------------------------------- -feature_defines_list = [ - "ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0", - "ENABLE_OILPAN=1", -] +feature_defines_list = [] if (is_debug) { feature_defines_list += [ "WTF_USE_DYNAMIC_ANNOTATIONS=1" ] } -if (use_concatenated_impulse_responses) { - feature_defines_list += [ "WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1" ] -} - if (use_low_quality_image_interpolation) { feature_defines_list += [ "WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION=1" ] }
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index 741cfb3..c9234d8 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1338,6 +1338,7 @@ "layout/shapes/BoxShapeTest.cpp", "layout/svg/LayoutSVGForeignObjectTest.cpp", "layout/svg/LayoutSVGRootTest.cpp", + "loader/BaseFetchContextTest.cpp", "loader/DocumentLoadTimingTest.cpp", "loader/FrameFetchContextTest.cpp", "loader/LinkLoaderTest.cpp",
diff --git a/third_party/WebKit/Source/core/dom/Modulator.h b/third_party/WebKit/Source/core/dom/Modulator.h index ef95e0b..f6f34ec 100644 --- a/third_party/WebKit/Source/core/dom/Modulator.h +++ b/third_party/WebKit/Source/core/dom/Modulator.h
@@ -78,8 +78,6 @@ virtual Vector<String> ModuleRequestsFromScriptModule(ScriptModule) = 0; - virtual void ExecuteModule(ScriptModule) = 0; - private: friend class ModuleMap;
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index bf78f2e..cca3bc9 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -469,14 +469,6 @@ ] }, { - "name": "setColorPickerEnabled", - "parameters": [ - { "name": "enabled", "type": "boolean", "description": "Shows / hides color picker" } - ], - "description": "Shows / hides color picker", - "experimental": true - }, - { "name": "configureOverlay", "parameters": [ { "name": "suspended", "type": "boolean", "optional": true, "description": "Whether overlay should be suspended and not consume any resources." }, @@ -633,14 +625,6 @@ "experimental": true }, { - "name": "colorPicked", - "description": "Fired when a color has been picked.", - "parameters": [ - { "name": "color", "$ref": "DOM.RGBA", "description": "RGBA of the picked color." } - ], - "experimental": true - }, - { "name": "interstitialShown", "description": "Fired when interstitial page was shown" },
diff --git a/third_party/WebKit/Source/core/loader/BUILD.gn b/third_party/WebKit/Source/core/loader/BUILD.gn index a8484a24..393c8b9 100644 --- a/third_party/WebKit/Source/core/loader/BUILD.gn +++ b/third_party/WebKit/Source/core/loader/BUILD.gn
@@ -6,6 +6,8 @@ blink_core_sources("loader") { sources = [ + "BaseFetchContext.cpp", + "BaseFetchContext.h", "CookieJar.cpp", "CookieJar.h", "DocumentLoadTiming.cpp",
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp new file mode 100644 index 0000000..9b38def1 --- /dev/null +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp
@@ -0,0 +1,86 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/loader/BaseFetchContext.h" + +#include "core/frame/csp/ContentSecurityPolicy.h" +#include "core/inspector/ConsoleMessage.h" +#include "platform/weborigin/SecurityPolicy.h" + +namespace blink { + +BaseFetchContext::BaseFetchContext(ExecutionContext* context) + : execution_context_(context) {} + +void BaseFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request, + FetchResourceType type) { + bool is_main_resource = type == kFetchMainResource; + if (!is_main_resource) { + if (!request.DidSetHTTPReferrer()) { + DCHECK(execution_context_); + request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( + execution_context_->GetReferrerPolicy(), request.Url(), + execution_context_->OutgoingReferrer())); + request.AddHTTPOriginIfNeeded(execution_context_->GetSecurityOrigin()); + } else { + DCHECK_EQ(SecurityPolicy::GenerateReferrer(request.GetReferrerPolicy(), + request.Url(), + request.HttpReferrer()) + .referrer, + request.HttpReferrer()); + request.AddHTTPOriginIfNeeded(request.HttpReferrer()); + } + } + + if (execution_context_) { + request.SetExternalRequestStateFromRequestorAddressSpace( + execution_context_->GetSecurityContext().AddressSpace()); + } +} + +SecurityOrigin* BaseFetchContext::GetSecurityOrigin() const { + return execution_context_ ? execution_context_->GetSecurityOrigin() : nullptr; +} + +void BaseFetchContext::PrintAccessDeniedMessage(const KURL& url) const { + if (url.IsNull()) + return; + + DCHECK(execution_context_); + String message; + if (execution_context_->Url().IsNull()) { + message = "Unsafe attempt to load URL " + url.ElidedString() + '.'; + } else if (url.IsLocalFile() || execution_context_->Url().IsLocalFile()) { + message = "Unsafe attempt to load URL " + url.ElidedString() + + " from frame with URL " + + execution_context_->Url().ElidedString() + + ". 'file:' URLs are treated as unique security origins.\n"; + } else { + message = "Unsafe attempt to load URL " + url.ElidedString() + + " from frame with URL " + + execution_context_->Url().ElidedString() + + ". Domains, protocols and ports must match.\n"; + } + + execution_context_->AddConsoleMessage(ConsoleMessage::Create( + kSecurityMessageSource, kErrorMessageLevel, message)); +} + +void BaseFetchContext::AddCSPHeaderIfNecessary(Resource::Type type, + ResourceRequest& request) { + if (!execution_context_) + return; + + const ContentSecurityPolicy* csp = + execution_context_->GetContentSecurityPolicy(); + if (csp->ShouldSendCSPHeader(type)) + request.AddHTTPHeaderField("CSP", "active"); +} + +DEFINE_TRACE(BaseFetchContext) { + visitor->Trace(execution_context_); + FetchContext::Trace(visitor); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.h b/third_party/WebKit/Source/core/loader/BaseFetchContext.h new file mode 100644 index 0000000..724233fe --- /dev/null +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.h
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BaseFetchContext_h +#define BaseFetchContext_h + +#include "core/CoreExport.h" +#include "core/dom/ExecutionContext.h" +#include "platform/heap/Handle.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/ResourceRequest.h" + +namespace blink { + +class CORE_EXPORT BaseFetchContext : public FetchContext { + public: + explicit BaseFetchContext(ExecutionContext*); + ~BaseFetchContext() override { execution_context_ = nullptr; } + + void AddAdditionalRequestHeaders(ResourceRequest&, + FetchResourceType) override; + SecurityOrigin* GetSecurityOrigin() const override; + + DECLARE_VIRTUAL_TRACE(); + + protected: + void PrintAccessDeniedMessage(const KURL&) const; + void AddCSPHeaderIfNecessary(Resource::Type, ResourceRequest&); + + // FIXME: Oilpan: Ideally this should just be a traced Member but that will + // currently leak because ComputedStyle and its data are not on the heap. + // See crbug.com/383860 for details. + WeakMember<ExecutionContext> execution_context_; +}; + +} // namespace blink + +#endif // BaseFetchContext_h
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp new file mode 100644 index 0000000..93b79ae --- /dev/null +++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -0,0 +1,186 @@ +/* + * Copyright (c) 2015, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/loader/BaseFetchContext.h" + +#include "core/testing/NullExecutionContext.h" +#include "platform/RuntimeEnabledFeatures.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class BaseFetchContextTest : public ::testing::Test { + protected: + void SetUp() override { + execution_context_ = new NullExecutionContext(); + fetch_context_ = new BaseFetchContext(execution_context_); + } + + Persistent<ExecutionContext> execution_context_; + Persistent<BaseFetchContext> fetch_context_; +}; + +TEST_F(BaseFetchContextTest, SetIsExternalRequestForPublicContext) { + EXPECT_EQ(kWebAddressSpacePublic, + execution_context_->GetSecurityContext().AddressSpace()); + + struct TestCase { + const char* url; + bool is_external_expectation; + } cases[] = { + {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, + {"blob:http://example.com/", false}, + + {"http://example.com/", false}, {"https://example.com/", false}, + + {"http://192.168.1.1:8000/", true}, {"http://10.1.1.1:8000/", true}, + + {"http://localhost/", true}, {"http://127.0.0.1/", true}, + {"http://127.0.0.1:8000/", true}}; + RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); + for (const auto& test : cases) { + SCOPED_TRACE(test.url); + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_FALSE(main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_FALSE(sub_request.IsExternalRequest()); + } + + RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); + for (const auto& test : cases) { + SCOPED_TRACE(test.url); + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); + } +} + +TEST_F(BaseFetchContextTest, SetIsExternalRequestForPrivateContext) { + execution_context_->GetSecurityContext().SetAddressSpace( + kWebAddressSpacePrivate); + EXPECT_EQ(kWebAddressSpacePrivate, + execution_context_->GetSecurityContext().AddressSpace()); + + struct TestCase { + const char* url; + bool is_external_expectation; + } cases[] = { + {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, + {"blob:http://example.com/", false}, + + {"http://example.com/", false}, {"https://example.com/", false}, + + {"http://192.168.1.1:8000/", false}, {"http://10.1.1.1:8000/", false}, + + {"http://localhost/", true}, {"http://127.0.0.1/", true}, + {"http://127.0.0.1:8000/", true}}; + RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); + for (const auto& test : cases) { + SCOPED_TRACE(test.url); + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_FALSE(main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_FALSE(sub_request.IsExternalRequest()); + } + + RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); + for (const auto& test : cases) { + SCOPED_TRACE(test.url); + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); + } +} + +TEST_F(BaseFetchContextTest, SetIsExternalRequestForLocalContext) { + execution_context_->GetSecurityContext().SetAddressSpace( + kWebAddressSpaceLocal); + EXPECT_EQ(kWebAddressSpaceLocal, + execution_context_->GetSecurityContext().AddressSpace()); + + struct TestCase { + const char* url; + bool is_external_expectation; + } cases[] = { + {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, + {"blob:http://example.com/", false}, + + {"http://example.com/", false}, {"https://example.com/", false}, + + {"http://192.168.1.1:8000/", false}, {"http://10.1.1.1:8000/", false}, + + {"http://localhost/", false}, {"http://127.0.0.1/", false}, + {"http://127.0.0.1:8000/", false}}; + + RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); + for (const auto& test : cases) { + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_FALSE(main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_FALSE(sub_request.IsExternalRequest()); + } + + RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); + for (const auto& test : cases) { + ResourceRequest main_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(main_request, + kFetchMainResource); + EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); + + ResourceRequest sub_request(test.url); + fetch_context_->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); + EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 9123c3a..aad2404 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -78,7 +78,6 @@ #include "platform/network/NetworkStateNotifier.h" #include "platform/network/NetworkUtils.h" #include "platform/weborigin/SchemeRegistry.h" -#include "platform/weborigin/SecurityPolicy.h" #include "platform/wtf/Vector.h" #include "public/platform/WebCachePolicy.h" #include "public/platform/WebInsecureRequestPolicy.h" @@ -296,24 +295,35 @@ } // namespace FrameFetchContext::FrameFetchContext(DocumentLoader* loader, Document* document) - : document_(document), document_loader_(loader) { + : BaseFetchContext(document), document_loader_(loader) { DCHECK(GetFrame()); } +void FrameFetchContext::ProvideDocumentToContext(FetchContext& context, + Document* document) { + DCHECK(document); + CHECK(context.IsFrameFetchContext()); + static_cast<FrameFetchContext&>(context).execution_context_ = document; +} + FrameFetchContext::~FrameFetchContext() { - document_ = nullptr; document_loader_ = nullptr; } LocalFrame* FrameFetchContext::FrameOfImportsController() const { - DCHECK(document_); - HTMLImportsController* imports_controller = document_->ImportsController(); + DCHECK(GetDocument()); + HTMLImportsController* imports_controller = + GetDocument()->ImportsController(); DCHECK(imports_controller); LocalFrame* frame = imports_controller->Master()->GetFrame(); DCHECK(frame); return frame; } +Document* FrameFetchContext::GetDocument() const { + return ToDocument(execution_context_.Get()); +} + LocalFrame* FrameFetchContext::GetFrame() const { if (!document_loader_) return FrameOfImportsController(); @@ -333,28 +343,7 @@ void FrameFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request, FetchResourceType type) { - bool is_main_resource = type == kFetchMainResource; - if (!is_main_resource) { - if (!request.DidSetHTTPReferrer()) { - DCHECK(document_); - request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( - document_->GetReferrerPolicy(), request.Url(), - document_->OutgoingReferrer())); - request.AddHTTPOriginIfNeeded(document_->GetSecurityOrigin()); - } else { - DCHECK_EQ(SecurityPolicy::GenerateReferrer(request.GetReferrerPolicy(), - request.Url(), - request.HttpReferrer()) - .referrer, - request.HttpReferrer()); - request.AddHTTPOriginIfNeeded(request.HttpReferrer()); - } - } - - if (document_) { - request.SetExternalRequestStateFromRequestorAddressSpace( - document_->AddressSpace()); - } + BaseFetchContext::AddAdditionalRequestHeaders(request, type); // The remaining modifications are only necessary for HTTP and HTTPS. if (!request.Url().IsEmpty() && !request.Url().ProtocolIsInHTTPFamily()) @@ -398,8 +387,8 @@ // add significant delays before page content is displayed on the screen. // TODO(toyoshim): Move following logic that rewrites ResourceRequest to // somewhere that should be relevant to the script resource handling. - if (type == Resource::kScript && IsMainFrame() && document_ && - ShouldDisallowFetchForMainFrameScript(request, defer, *document_)) + if (type == Resource::kScript && IsMainFrame() && GetDocument() && + ShouldDisallowFetchForMainFrameScript(request, defer, *GetDocument())) return WebCachePolicy::kReturnCacheDataDontLoad; const WebCachePolicy cache_policy = DetermineFrameWebCachePolicy( @@ -629,14 +618,14 @@ void FrameFetchContext::DidLoadResource(Resource* resource) { if (resource->IsLoadEventBlockingResourceType()) GetFrame()->Loader().CheckCompleted(); - if (document_) - FirstMeaningfulPaintDetector::From(*document_).CheckNetworkStable(); + if (GetDocument()) + FirstMeaningfulPaintDetector::From(*GetDocument()).CheckNetworkStable(); } void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) { - Document* initiator_document = document_ && info.IsMainResource() - ? document_->ParentDocument() - : document_.Get(); + Document* initiator_document = GetDocument() && info.IsMainResource() + ? GetDocument()->ParentDocument() + : GetDocument(); if (!initiator_document || !initiator_document->domWindow()) return; DOMWindowPerformance::performance(*initiator_document->domWindow()) @@ -647,27 +636,6 @@ return GetContentSettingsClient()->AllowImage(images_enabled, url); } -void FrameFetchContext::PrintAccessDeniedMessage(const KURL& url) const { - if (url.IsNull()) - return; - - String message; - if (!document_ || document_->Url().IsNull()) { - message = "Unsafe attempt to load URL " + url.ElidedString() + '.'; - } else if (url.IsLocalFile() || document_->Url().IsLocalFile()) { - message = "Unsafe attempt to load URL " + url.ElidedString() + - " from frame with URL " + document_->Url().ElidedString() + - ". 'file:' URLs are treated as unique security origins.\n"; - } else { - message = "Unsafe attempt to load URL " + url.ElidedString() + - " from frame with URL " + document_->Url().ElidedString() + - ". Domains, protocols and ports must match.\n"; - } - - GetFrame()->GetDocument()->AddConsoleMessage(ConsoleMessage::Create( - kSecurityMessageSource, kErrorMessageLevel, message)); -} - ResourceRequestBlockedReason FrameFetchContext::CanRequest( Resource::Type type, const ResourceRequest& resource_request, @@ -718,8 +686,8 @@ return ResourceRequestBlockedReason::kInspector; SecurityOrigin* security_origin = options.security_origin.Get(); - if (!security_origin && document_) - security_origin = document_->GetSecurityOrigin(); + if (!security_origin && execution_context_) + security_origin = execution_context_->GetSecurityOrigin(); if (origin_restriction != FetchParameters::kNoOriginRestriction && security_origin && !security_origin->CanDisplay(url)) { @@ -771,10 +739,10 @@ options.content_security_policy_option == kDoNotCheckContentSecurityPolicy; - if (document_) { - DCHECK(document_->GetContentSecurityPolicy()); + if (execution_context_) { + DCHECK(execution_context_->GetContentSecurityPolicy()); if (!should_bypass_main_world_csp && - !document_->GetContentSecurityPolicy()->AllowRequest( + !execution_context_->GetContentSecurityPolicy()->AllowRequest( resource_request.GetRequestContext(), url, options.content_security_policy_nonce, options.integrity_metadata, options.parser_disposition, redirect_status, reporting_policy)) @@ -907,12 +875,12 @@ } bool FrameFetchContext::IsLoadComplete() const { - return document_ && document_->LoadEventFinished(); + return GetDocument() && GetDocument()->LoadEventFinished(); } bool FrameFetchContext::PageDismissalEventBeingDispatched() const { - return document_ && document_->PageDismissalEventBeingDispatched() != - Document::kNoDismissal; + return GetDocument() && GetDocument()->PageDismissalEventBeingDispatched() != + Document::kNoDismissal; } bool FrameFetchContext::UpdateTimingInfoForIFrameNavigation( @@ -946,43 +914,39 @@ } } -SecurityOrigin* FrameFetchContext::GetSecurityOrigin() const { - return document_ ? document_->GetSecurityOrigin() : nullptr; -} - void FrameFetchContext::ModifyRequestForCSP(ResourceRequest& resource_request) { // Record the latest requiredCSP value that will be used when sending this // request. GetFrame()->Loader().RecordLatestRequiredCSP(); - GetFrame()->Loader().ModifyRequestForCSP(resource_request, document_); + GetFrame()->Loader().ModifyRequestForCSP(resource_request, GetDocument()); } void FrameFetchContext::AddClientHintsIfNecessary( const ClientHintsPreferences& hints_preferences, const FetchParameters::ResourceWidth& resource_width, ResourceRequest& request) { - if (!RuntimeEnabledFeatures::clientHintsEnabled() || !document_) + if (!RuntimeEnabledFeatures::clientHintsEnabled() || !GetDocument()) return; bool should_send_dpr = - document_->GetClientHintsPreferences().ShouldSendDPR() || + GetDocument()->GetClientHintsPreferences().ShouldSendDPR() || hints_preferences.ShouldSendDPR(); bool should_send_resource_width = - document_->GetClientHintsPreferences().ShouldSendResourceWidth() || + GetDocument()->GetClientHintsPreferences().ShouldSendResourceWidth() || hints_preferences.ShouldSendResourceWidth(); bool should_send_viewport_width = - document_->GetClientHintsPreferences().ShouldSendViewportWidth() || + GetDocument()->GetClientHintsPreferences().ShouldSendViewportWidth() || hints_preferences.ShouldSendViewportWidth(); if (should_send_dpr) { request.AddHTTPHeaderField( - "DPR", AtomicString(String::Number(document_->DevicePixelRatio()))); + "DPR", AtomicString(String::Number(GetDocument()->DevicePixelRatio()))); } if (should_send_resource_width) { if (resource_width.is_set) { float physical_width = - resource_width.width * document_->DevicePixelRatio(); + resource_width.width * GetDocument()->DevicePixelRatio(); request.AddHTTPHeaderField( "Width", AtomicString(String::Number(ceil(physical_width)))); } @@ -995,16 +959,6 @@ } } -void FrameFetchContext::AddCSPHeaderIfNecessary(Resource::Type type, - ResourceRequest& request) { - if (!document_) - return; - - const ContentSecurityPolicy* csp = document_->GetContentSecurityPolicy(); - if (csp->ShouldSendCSPHeader(type)) - request.AddHTTPHeaderField("CSP", "active"); -} - void FrameFetchContext::PopulateResourceRequest( Resource::Type type, const ClientHintsPreferences& hints_preferences, @@ -1018,13 +972,13 @@ void FrameFetchContext::SetFirstPartyCookieAndRequestorOrigin( ResourceRequest& request) { - if (!document_) + if (!GetDocument()) return; if (request.FirstPartyForCookies().IsNull()) { request.SetFirstPartyForCookies( - document_ ? document_->FirstPartyForCookies() - : SecurityOrigin::UrlWithUniqueSecurityOrigin()); + GetDocument() ? GetDocument()->FirstPartyForCookies() + : SecurityOrigin::UrlWithUniqueSecurityOrigin()); } // Subresource requests inherit their requestor origin from |m_document| @@ -1036,9 +990,10 @@ // `isNull()` check. https://crbug.com/625969 if (request.GetFrameType() == WebURLRequest::kFrameTypeNone && request.RequestorOrigin()->IsUnique()) { - request.SetRequestorOrigin(document_->IsSandboxed(kSandboxOrigin) - ? SecurityOrigin::Create(document_->Url()) - : document_->GetSecurityOrigin()); + request.SetRequestorOrigin( + GetDocument()->IsSandboxed(kSandboxOrigin) + ? SecurityOrigin::Create(execution_context_->Url()) + : execution_context_->GetSecurityOrigin()); } } @@ -1076,9 +1031,8 @@ } DEFINE_TRACE(FrameFetchContext) { - visitor->Trace(document_); visitor->Trace(document_loader_); - FetchContext::Trace(visitor); + BaseFetchContext::Trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index 05a6e6d..1bf5355a 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
@@ -32,9 +32,8 @@ #define FrameFetchContext_h #include "core/CoreExport.h" -#include "core/frame/csp/ContentSecurityPolicy.h" +#include "core/loader/BaseFetchContext.h" #include "platform/heap/Handle.h" -#include "platform/loader/fetch/FetchContext.h" #include "platform/loader/fetch/FetchParameters.h" #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/loader/fetch/ResourceRequest.h" @@ -51,7 +50,7 @@ class ResourceError; class ResourceResponse; -class CORE_EXPORT FrameFetchContext final : public FetchContext { +class CORE_EXPORT FrameFetchContext final : public BaseFetchContext { public: static ResourceFetcher* CreateFetcherFromDocumentLoader( DocumentLoader* loader) { @@ -61,16 +60,11 @@ return ResourceFetcher::Create(new FrameFetchContext(nullptr, document)); } - static void ProvideDocumentToContext(FetchContext& context, - Document* document) { - DCHECK(document); - CHECK(context.IsLiveContext()); - static_cast<FrameFetchContext&>(context).document_ = document; - } + static void ProvideDocumentToContext(FetchContext&, Document*); - ~FrameFetchContext(); + ~FrameFetchContext() override; - bool IsLiveContext() { return true; } + bool IsFrameFetchContext() { return true; } void AddAdditionalRequestHeaders(ResourceRequest&, FetchResourceType) override; @@ -146,7 +140,6 @@ void SendImagePing(const KURL&) override; void AddConsoleMessage(const String&, LogMessageType = kLogErrorMessage) const override; - SecurityOrigin* GetSecurityOrigin() const override; void PopulateResourceRequest(Resource::Type, const ClientHintsPreferences&, @@ -178,6 +171,7 @@ // relevant document loader or frame in either cases without null-checks. // TODO(kinuko): Remove constness, these return non-const members. DocumentLoader* MasterDocumentLoader() const; + Document* GetDocument() const; LocalFrame* GetFrame() const; LocalFrameClient* GetLocalFrameClient() const; @@ -185,7 +179,6 @@ LocalFrame* FrameOfImportsController() const; - void PrintAccessDeniedMessage(const KURL&) const; ResourceRequestBlockedReason CanRequestInternal( Resource::Type, const ResourceRequest&, @@ -195,12 +188,6 @@ FetchParameters::OriginRestriction, ResourceRequest::RedirectStatus) const; - void AddCSPHeaderIfNecessary(Resource::Type, ResourceRequest&); - - // FIXME: Oilpan: Ideally this should just be a traced Member but that will - // currently leak because ComputedStyle and its data are not on the heap. - // See crbug.com/383860 for details. - WeakMember<Document> document_; Member<DocumentLoader> document_loader_; };
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index 95e2ca8..3de3325 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -867,136 +867,6 @@ CreateUniqueIdentifier(), resource_request, resource->GetResponse()); } -TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) { - EXPECT_EQ(kWebAddressSpacePublic, document->AddressSpace()); - - struct TestCase { - const char* url; - bool is_external_expectation; - } cases[] = { - {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, - {"blob:http://example.com/", false}, - - {"http://example.com/", false}, {"https://example.com/", false}, - - {"http://192.168.1.1:8000/", true}, {"http://10.1.1.1:8000/", true}, - - {"http://localhost/", true}, {"http://127.0.0.1/", true}, - {"http://127.0.0.1:8000/", true}}; - RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); - for (const auto& test : cases) { - SCOPED_TRACE(test.url); - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_FALSE(main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_FALSE(sub_request.IsExternalRequest()); - } - - RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); - for (const auto& test : cases) { - SCOPED_TRACE(test.url); - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); - } -} - -TEST_F(FrameFetchContextTest, SetIsExternalRequestForPrivateDocument) { - document->SetAddressSpace(kWebAddressSpacePrivate); - EXPECT_EQ(kWebAddressSpacePrivate, document->AddressSpace()); - - struct TestCase { - const char* url; - bool is_external_expectation; - } cases[] = { - {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, - {"blob:http://example.com/", false}, - - {"http://example.com/", false}, {"https://example.com/", false}, - - {"http://192.168.1.1:8000/", false}, {"http://10.1.1.1:8000/", false}, - - {"http://localhost/", true}, {"http://127.0.0.1/", true}, - {"http://127.0.0.1:8000/", true}}; - RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); - for (const auto& test : cases) { - SCOPED_TRACE(test.url); - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_FALSE(main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_FALSE(sub_request.IsExternalRequest()); - } - - RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); - for (const auto& test : cases) { - SCOPED_TRACE(test.url); - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); - } -} - -TEST_F(FrameFetchContextTest, SetIsExternalRequestForLocalDocument) { - document->SetAddressSpace(kWebAddressSpaceLocal); - EXPECT_EQ(kWebAddressSpaceLocal, document->AddressSpace()); - - struct TestCase { - const char* url; - bool is_external_expectation; - } cases[] = { - {"data:text/html,whatever", false}, {"file:///etc/passwd", false}, - {"blob:http://example.com/", false}, - - {"http://example.com/", false}, {"https://example.com/", false}, - - {"http://192.168.1.1:8000/", false}, {"http://10.1.1.1:8000/", false}, - - {"http://localhost/", false}, {"http://127.0.0.1/", false}, - {"http://127.0.0.1:8000/", false}}; - - RuntimeEnabledFeatures::setCorsRFC1918Enabled(false); - for (const auto& test : cases) { - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_FALSE(main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_FALSE(sub_request.IsExternalRequest()); - } - - RuntimeEnabledFeatures::setCorsRFC1918Enabled(true); - for (const auto& test : cases) { - ResourceRequest main_request(test.url); - fetch_context->AddAdditionalRequestHeaders(main_request, - kFetchMainResource); - EXPECT_EQ(test.is_external_expectation, main_request.IsExternalRequest()); - - ResourceRequest sub_request(test.url); - fetch_context->AddAdditionalRequestHeaders(sub_request, kFetchSubresource); - EXPECT_EQ(test.is_external_expectation, sub_request.IsExternalRequest()); - } -} - TEST_F(FrameFetchContextSubresourceFilterTest, Filter) { SetFilterPolicy(WebDocumentSubresourceFilter::kDisallow);
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp index 6aa997cb..da24d7a 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -266,6 +266,13 @@ ClipRect& background_rect, ClipRect& foreground_rect, const LayoutPoint* offset_from_root) const { + LayoutPoint offset(context.sub_pixel_accumulation); + if (offset_from_root) + offset = *offset_from_root; + else + layer_.ConvertToLayerCoords(context.root_layer, offset); + layer_bounds = LayoutRect(offset, LayoutSize(layer_.size())); + // TODO(chrishtr): fix the underlying bug that causes this situation. if (!layer_.GetLayoutObject().PaintProperties() && !layer_.GetLayoutObject().LocalBorderBoxProperties()) { @@ -276,17 +283,23 @@ background_rect.Move(context.sub_pixel_accumulation); background_rect.Intersect(paint_dirty_rect); - CalculateForegroundClipRectWithGeometryMapper(context, foreground_rect); - foreground_rect.Move(context.sub_pixel_accumulation); - foreground_rect.Intersect(paint_dirty_rect); - } + foreground_rect = background_rect; - LayoutPoint offset; - if (offset_from_root) - offset = *offset_from_root; - else - layer_.ConvertToLayerCoords(context.root_layer, offset); - layer_bounds = LayoutRect(offset, LayoutSize(layer_.size())); + LayoutBoxModelObject& layout_object = layer_.GetLayoutObject(); + if (layout_object.HasClip()) { + LayoutRect new_pos_clip = ToLayoutBox(layout_object).ClipRect(offset); + foreground_rect.Intersect(new_pos_clip); + } + if (ShouldClipOverflow(context)) { + LayoutRect overflow_and_clip_rect = + ToLayoutBox(layout_object) + .OverflowClipRect(offset, + context.overlay_scrollbar_clip_behavior); + foreground_rect.Intersect(overflow_and_clip_rect); + if (layout_object.StyleRef().HasBorderRadius()) + foreground_rect.SetHasRadius(true); + } + } #ifdef CHECK_CLIP_RECTS ClipRect testBackgroundRect, testForegroundRect; @@ -327,7 +340,7 @@ foreground_rect = background_rect; - LayoutPoint offset; + LayoutPoint offset(context.sub_pixel_accumulation); if (offset_from_root) offset = *offset_from_root; else @@ -485,47 +498,6 @@ } } -void PaintLayerClipper::CalculateForegroundClipRectWithGeometryMapper( - const ClipRectsContext& context, - ClipRect& output) const { - DCHECK(use_geometry_mapper_); - PropertyTreeState source_property_tree_state(nullptr, nullptr, nullptr); - PropertyTreeState destination_property_tree_state(nullptr, nullptr, nullptr); - InitializeCommonClipRectState(context, source_property_tree_state, - destination_property_tree_state); - const auto* properties = layer_.GetLayoutObject().PaintProperties(); - - if (&layer_ == context.root_layer) { - // Set the overflow clip for |sourcePropertyTreeState| so that it differs - // from |destinationPropertyTreeState| in its clip. - if (context.respect_overflow_clip == kRespectOverflowClip && properties && - properties->OverflowClip()) - source_property_tree_state.SetClip(properties->OverflowClip()); - } else { - const auto* ancestor_properties = - context.root_layer->GetLayoutObject().PaintProperties(); - - // Set the clip of |destinationPropertyTreeState| to be inside the - // ancestor's overflow clip, so that that clip is not applied. - if (context.respect_overflow_clip == kIgnoreOverflowClip && - ancestor_properties && ancestor_properties->OverflowClip()) - destination_property_tree_state.SetClip( - ancestor_properties->OverflowClip()); - - // Set the overflow clip for |sourcePropertyTreeState| so that it differs - // from destinationPropertyTreeState| in its clip. - if (properties && properties->OverflowClip()) - source_property_tree_state.SetClip(properties->OverflowClip()); - } - - const FloatClipRect& clipped_rect_in_root_layer_space = - GeometryMapper::SourceToDestinationClipRect( - source_property_tree_state, destination_property_tree_state); - output.SetRect(clipped_rect_in_root_layer_space); - - output.MoveBy(-context.root_layer->GetLayoutObject().PaintOffset()); -} - LayoutRect PaintLayerClipper::LocalVisualRect() const { const LayoutObject& layout_object = layer_.GetLayoutObject(); // The LayoutView is special since its overflow clipping rect may be larger
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h index 4f0addb..f37081d7 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
@@ -191,8 +191,11 @@ ClipRect& output) const; // This method figures out our layerBounds in coordinates relative to - // |rootLayer|. It also computes our background and foreground clip rects + // |root_layer|. It also computes our background and foreground clip rects // for painting/event handling. Pass offsetFromRoot if known. + // If provided, |offset_from_root| is not changed and assumed to already + // include subpixel accumualation. Otherwise it is set to the offset from + // |layer_| to |root_layer|, plus |context.sub_pixel_accumuation|. void CalculateRects(const ClipRectsContext&, const LayoutRect& paint_dirty_rect, LayoutRect& layer_bounds, @@ -223,9 +226,6 @@ ALWAYS_INLINE void CalculateBackgroundClipRectWithGeometryMapper( const ClipRectsContext&, ClipRect& output) const; - ALWAYS_INLINE void CalculateForegroundClipRectWithGeometryMapper( - const ClipRectsContext&, - ClipRect& output) const; ALWAYS_INLINE void InitializeCommonClipRectState( const ClipRectsContext&,
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp index e48f33a..b41fdfe 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -63,17 +63,18 @@ target_paint_layer->Clipper(option).CalculateRects( context, LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds, background_rect, foreground_rect); - // TODO(chrishtr): investigate why these differences exist. + + EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), + background_rect.Rect()); if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { - EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), - background_rect.Rect()); - EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), + EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 199.75, 299.66)), foreground_rect.Rect()); } else { - EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), background_rect.Rect()); + // TODO(chrishtr): this is off by 0.25px because + // LayoutSVGRoot::OverflowClipRect incorrectly does pixel-snapping. EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), foreground_rect.Rect()); } - EXPECT_EQ(LayoutRect(8, 8, 200, 300), layer_bounds); + EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), layer_bounds); } TEST_P(PaintLayerClipperTest, ControlClip) {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp index f9320de2..0a6cd48 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -964,6 +964,13 @@ case kPaintPhaseMask: // Mask painting will handle clipping to self. clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; break; + case kPaintPhaseClippingMask: + if (paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase) { + // The ancestor is the thing that needs to clip, so do not include + // this layer's clips. + clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; + break; + } default: clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius; break;
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.cpp b/third_party/WebKit/Source/core/testing/DummyModulator.cpp index 3267998e..80f5d08c 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.cpp +++ b/third_party/WebKit/Source/core/testing/DummyModulator.cpp
@@ -64,8 +64,4 @@ return Vector<String>(); } -void DummyModulator::ExecuteModule(ScriptModule) { - NOTREACHED(); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.h b/third_party/WebKit/Source/core/testing/DummyModulator.h index 561255c..4e7d749 100644 --- a/third_party/WebKit/Source/core/testing/DummyModulator.h +++ b/third_party/WebKit/Source/core/testing/DummyModulator.h
@@ -45,7 +45,6 @@ AccessControlStatus) override; ScriptValue InstantiateModule(ScriptModule) override; Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override; - void ExecuteModule(ScriptModule) override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/devtools/front_end/color_picker/Spectrum.js b/third_party/WebKit/Source/devtools/front_end/color_picker/Spectrum.js index 9aacdf0..8233b65 100644 --- a/third_party/WebKit/Source/devtools/front_end/color_picker/Spectrum.js +++ b/third_party/WebKit/Source/devtools/front_end/color_picker/Spectrum.js
@@ -140,6 +140,8 @@ addColorButton.addEventListener(UI.ToolbarButton.Events.Click, this._addColorToCustomPalette, this); this._addColorToolbar.appendToolbarItem(addColorButton); + this._colorPickedBound = this._colorPicked.bind(this); + this._loadPalettes(); new ColorPicker.Spectrum.PaletteGenerator(this._generatedPaletteLoaded.bind(this)); @@ -855,8 +857,6 @@ this._colorDragElementHeight = this._colorDragElement.offsetHeight / 2; this._innerSetColor(undefined, undefined, undefined, ColorPicker.Spectrum._ChangeSource.Model); this._toggleColorPicker(true); - SDK.targetManager.addModelListener( - SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); } /** @@ -864,8 +864,6 @@ */ willHide() { this._toggleColorPicker(false); - SDK.targetManager.removeModelListener( - SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); } /** @@ -876,15 +874,21 @@ if (enabled === undefined) enabled = !this._colorPickerButton.toggled(); this._colorPickerButton.setToggled(enabled); - for (var target of SDK.targetManager.targets()) - target.pageAgent().setColorPickerEnabled(enabled); + InspectorFrontendHost.setEyeDropperActive(enabled); + if (enabled) { + InspectorFrontendHost.events.addEventListener( + InspectorFrontendHostAPI.Events.EyeDropperPickedColor, this._colorPickedBound); + } else { + InspectorFrontendHost.events.removeEventListener( + InspectorFrontendHostAPI.Events.EyeDropperPickedColor, this._colorPickedBound); + } } /** * @param {!Common.Event} event */ _colorPicked(event) { - var rgbColor = /** @type {!Protocol.DOM.RGBA} */ (event.data); + var rgbColor = /** @type {!{r: number, g: number, b: number, a: number}} */ (event.data); var rgba = [rgbColor.r, rgbColor.g, rgbColor.b, (rgbColor.a / 2.55 | 0) / 100]; var color = Common.Color.fromRGBA(rgba); this._innerSetColor(color.hsva(), '', undefined, ColorPicker.Spectrum._ChangeSource.Other);
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js index 8ecd437..be61b1a8 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -177,8 +177,6 @@ ConsoleModel.consoleModel.addEventListener( ConsoleModel.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this); ConsoleModel.consoleModel.messages().forEach(this._addConsoleMessage, this); - if (this._consoleMessages.length) - this._viewport.invalidate(); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js b/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js index c9b517b..05a6c5e8 100644 --- a/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js +++ b/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js
@@ -158,6 +158,13 @@ } /** + * @param {!{r: number, g: number, b: number, a: number}} color + */ + eyeDropperPickedColor(color) { + this._dispatchOnInspectorFrontendAPI('eyeDropperPickedColor', [color]); + } + + /** * @param {!Array.<!{fileSystemName: string, rootURL: string, fileSystemPath: string}>} fileSystems */ fileSystemsLoaded(fileSystems) { @@ -621,6 +628,14 @@ /** * @override + * @param {boolean} active + */ + setEyeDropperActive(active) { + DevToolsAPI.sendMessageToEmbedder('setEyeDropperActive', [active], null); + } + + /** + * @override * @param {!Array<string>} certChain */ showCertificateViewer(certChain) {
diff --git a/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersUtils.js b/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersUtils.js index 43ea49f5..9660154 100644 --- a/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersUtils.js
@@ -12,7 +12,8 @@ * @return {!Promise<!EventListeners.FrameworkEventListenersObject>} */ EventListeners.frameworkEventListeners = function(object) { - if (!object.runtimeModel().target().hasDOMCapability()) { + var domDebuggerModel = object.runtimeModel().target().model(SDK.DOMDebuggerModel); + if (!domDebuggerModel) { // TODO(kozyatinskiy): figure out how this should work for |window|. return Promise.resolve( /** @type {!EventListeners.FrameworkEventListenersObject} */ ({eventListeners: [], internalHandlers: null})); @@ -177,8 +178,8 @@ if (!location) throw new Error('Empty event listener\'s location'); return new SDK.EventListener( - handler.runtimeModel(), object, type, useCapture, passive, once, handler, originalHandler, location, - removeFunctionObject, SDK.EventListener.Origin.FrameworkUser); + /** @type {!SDK.DOMDebuggerModel} */ (domDebuggerModel), object, type, useCapture, passive, once, handler, + originalHandler, location, removeFunctionObject, SDK.EventListener.Origin.FrameworkUser); } } }
diff --git a/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersView.js b/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersView.js index 8742f0c..7841fe1 100644 --- a/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersView.js +++ b/third_party/WebKit/Source/devtools/front_end/event_listeners/EventListenersView.js
@@ -50,18 +50,21 @@ * @return {!Promise<undefined>} */ _addObject(object) { - /** @type {?Array<!SDK.EventListener>} */ - var eventListeners = null; + /** @type {!Array<!SDK.EventListener>} */ + var eventListeners; /** @type {?EventListeners.FrameworkEventListenersObject}*/ var frameworkEventListenersObject = null; var promises = []; - promises.push(object.eventListeners().then(storeEventListeners)); + var domDebuggerModel = object.runtimeModel().target().model(SDK.DOMDebuggerModel); + // TODO(kozyatinskiy): figure out how this should work for |window| when there is no DOMDebugger. + if (domDebuggerModel) + promises.push(domDebuggerModel.eventListeners(object).then(storeEventListeners)); promises.push(EventListeners.frameworkEventListeners(object).then(storeFrameworkEventListenersObject)); return Promise.all(promises).then(markInternalEventListeners).then(addEventListeners.bind(this)); /** - * @param {?Array<!SDK.EventListener>} result + * @param {!Array<!SDK.EventListener>} result */ function storeEventListeners(result) { eventListeners = result; @@ -78,7 +81,7 @@ * @return {!Promise<undefined>} */ function markInternalEventListeners() { - if (!eventListeners || !frameworkEventListenersObject.internalHandlers) + if (!frameworkEventListenersObject.internalHandlers) return Promise.resolve(undefined); return frameworkEventListenersObject.internalHandlers.object() .callFunctionJSONPromise(isInternalEventListener, eventListeners.map(handlerArgument)) @@ -267,7 +270,7 @@ onpopulate() { var properties = []; var eventListener = this._eventListener; - var runtimeModel = eventListener.runtimeModel(); + var runtimeModel = eventListener.domDebuggerModel().runtimeModel(); properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue('useCapture', eventListener.useCapture())); properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue('passive', eventListener.passive())); properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue('once', eventListener.once()));
diff --git a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js index 27c4f9e..94f8b8a 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js +++ b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js
@@ -339,6 +339,13 @@ } /** + * @override + * @param {boolean} active + */ + setEyeDropperActive(active) { + } + + /** * @param {!Array<string>} certChain * @override */
diff --git a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHostAPI.js b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHostAPI.js index 758f21a..d00516af 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHostAPI.js +++ b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHostAPI.js
@@ -38,6 +38,7 @@ DispatchMessageChunk: Symbol('dispatchMessageChunk'), EnterInspectElementMode: Symbol('enterInspectElementMode'), EvaluateForTestInFrontend: Symbol('evaluateForTestInFrontend'), + EyeDropperPickedColor: Symbol('eyeDropperPickedColor'), FileSystemsLoaded: Symbol('fileSystemsLoaded'), FileSystemRemoved: Symbol('fileSystemRemoved'), FileSystemAdded: Symbol('fileSystemAdded'), @@ -74,6 +75,7 @@ [InspectorFrontendHostAPI.Events.DispatchMessageChunk, 'dispatchMessageChunk', ['messageChunk', 'messageSize']], [InspectorFrontendHostAPI.Events.EnterInspectElementMode, 'enterInspectElementMode', []], [InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, 'evaluateForTestInFrontend', ['callId', 'script']], + [InspectorFrontendHostAPI.Events.EyeDropperPickedColor, 'eyeDropperPickedColor', ['color']], [InspectorFrontendHostAPI.Events.FileSystemsLoaded, 'fileSystemsLoaded', ['fileSystems']], [InspectorFrontendHostAPI.Events.FileSystemRemoved, 'fileSystemRemoved', ['fileSystemPath']], [InspectorFrontendHostAPI.Events.FileSystemAdded, 'fileSystemAdded', ['errorMessage', 'fileSystem']], @@ -143,6 +145,11 @@ */ setWhitelistedShortcuts(shortcuts) {}, + /** + * @param {boolean} active + */ + setEyeDropperActive(active) {}, + inspectElementCompleted() {}, /**
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js index 4d65524..616ed1b2 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -214,7 +214,6 @@ UI.ShortcutsScreen.registerShortcuts(); this._registerForwardedShortcuts(); this._registerMessageSinkListener(); - new Main.Main.InspectorDomainObserver(); self.runtime.extension(Common.AppProvider).instance().then(this._showAppUI.bind(this)); console.timeEnd('Main._createAppUI'); @@ -445,41 +444,16 @@ }; /** - * @implements {SDK.TargetManager.Observer} - * @unrestricted - */ -Main.Main.InspectorDomainObserver = class { - constructor() { - SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); - } - - /** - * @override - * @param {!SDK.Target} target - */ - targetAdded(target) { - target.registerInspectorDispatcher(new Main.Main.InspectorDomainDispatcher(target)); - target.inspectorAgent().enable(); - } - - /** - * @override - * @param {!SDK.Target} target - */ - targetRemoved(target) { - } -}; - -/** * @implements {Protocol.InspectorDispatcher} - * @unrestricted */ -Main.Main.InspectorDomainDispatcher = class { +Main.Main.InspectorModel = class extends SDK.SDKModel { /** * @param {!SDK.Target} target */ constructor(target) { - this._target = target; + super(target); + target.registerInspectorDispatcher(this); + target.inspectorAgent().enable(); } /** @@ -495,12 +469,14 @@ * @override */ targetCrashed() { - var debuggerModel = this._target.model(SDK.DebuggerModel); + var debuggerModel = this.target().model(SDK.DebuggerModel); if (debuggerModel) Main.TargetCrashedScreen.show(debuggerModel); } }; +SDK.SDKModel.register(Main.Main.InspectorModel, SDK.Target.Capability.Inspector, true); + /** * @implements {UI.ActionDelegate} * @unrestricted
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMDebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMDebuggerModel.js index e5369174..42b836a0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMDebuggerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMDebuggerModel.js
@@ -12,10 +12,254 @@ this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.RuntimeModel)); this._domModel = /** @type {!SDK.DOMModel} */ (target.model(SDK.DOMModel)); } + + /** + * @return {!SDK.RuntimeModel} + */ + runtimeModel() { + return this._runtimeModel; + } + + /** + * @param {!SDK.RemoteObject} remoteObject + * @return {!Promise<!Array<!SDK.EventListener>>} + */ + async eventListeners(remoteObject) { + console.assert(remoteObject.runtimeModel() === this._runtimeModel); + if (!remoteObject.objectId) + return []; + + var payloads = await this._agent.getEventListeners( + /** @type {string} */ (remoteObject.objectId), undefined, undefined, + (error, payloads) => error ? [] : payloads); + var eventListeners = []; + for (var payload of payloads) { + var location = this._runtimeModel.debuggerModel().createRawLocationByScriptId( + payload.scriptId, payload.lineNumber, payload.columnNumber); + eventListeners.push(new SDK.EventListener( + this, remoteObject, payload.type, payload.useCapture, payload.passive, payload.once, + payload.handler ? this._runtimeModel.createRemoteObject(payload.handler) : null, + payload.originalHandler ? this._runtimeModel.createRemoteObject(payload.originalHandler) : null, + /** @type {!SDK.DebuggerModel.Location} */ (location), null)); + } + return eventListeners; + } }; SDK.SDKModel.register(SDK.DOMDebuggerModel, SDK.Target.Capability.DOM, false); +SDK.EventListener = class { + /** + * @param {!SDK.DOMDebuggerModel} domDebuggerModel + * @param {!SDK.RemoteObject} eventTarget + * @param {string} type + * @param {boolean} useCapture + * @param {boolean} passive + * @param {boolean} once + * @param {?SDK.RemoteObject} handler + * @param {?SDK.RemoteObject} originalHandler + * @param {!SDK.DebuggerModel.Location} location + * @param {?SDK.RemoteObject} customRemoveFunction + * @param {!SDK.EventListener.Origin=} origin + */ + constructor( + domDebuggerModel, eventTarget, type, useCapture, passive, once, handler, originalHandler, location, + customRemoveFunction, origin) { + this._domDebuggerModel = domDebuggerModel; + this._eventTarget = eventTarget; + this._type = type; + this._useCapture = useCapture; + this._passive = passive; + this._once = once; + this._handler = handler; + this._originalHandler = originalHandler || handler; + this._location = location; + var script = location.script(); + this._sourceURL = script ? script.contentURL() : ''; + this._customRemoveFunction = customRemoveFunction; + this._origin = origin || SDK.EventListener.Origin.Raw; + } + + /** + * @return {!SDK.DOMDebuggerModel} + */ + domDebuggerModel() { + return this._domDebuggerModel; + } + + /** + * @return {string} + */ + type() { + return this._type; + } + + /** + * @return {boolean} + */ + useCapture() { + return this._useCapture; + } + + /** + * @return {boolean} + */ + passive() { + return this._passive; + } + + /** + * @return {boolean} + */ + once() { + return this._once; + } + + /** + * @return {?SDK.RemoteObject} + */ + handler() { + return this._handler; + } + + /** + * @return {!SDK.DebuggerModel.Location} + */ + location() { + return this._location; + } + + /** + * @return {string} + */ + sourceURL() { + return this._sourceURL; + } + + /** + * @return {?SDK.RemoteObject} + */ + originalHandler() { + return this._originalHandler; + } + + /** + * @return {boolean} + */ + canRemove() { + return !!this._customRemoveFunction || this._origin !== SDK.EventListener.Origin.FrameworkUser; + } + + /** + * @return {!Promise<undefined>} + */ + remove() { + if (!this.canRemove()) + return Promise.resolve(); + + if (this._origin !== SDK.EventListener.Origin.FrameworkUser) { + /** + * @param {string} type + * @param {function()} listener + * @param {boolean} useCapture + * @this {Object} + * @suppressReceiverCheck + */ + function removeListener(type, listener, useCapture) { + this.removeEventListener(type, listener, useCapture); + if (this['on' + type]) + this['on' + type] = undefined; + } + + return /** @type {!Promise<undefined>} */ (this._eventTarget.callFunctionPromise(removeListener, [ + SDK.RemoteObject.toCallArgument(this._type), SDK.RemoteObject.toCallArgument(this._originalHandler), + SDK.RemoteObject.toCallArgument(this._useCapture) + ])); + } + + return this._customRemoveFunction + .callFunctionPromise( + callCustomRemove, + [ + SDK.RemoteObject.toCallArgument(this._type), + SDK.RemoteObject.toCallArgument(this._originalHandler), + SDK.RemoteObject.toCallArgument(this._useCapture), + SDK.RemoteObject.toCallArgument(this._passive), + ]) + .then(() => undefined); + + /** + * @param {string} type + * @param {function()} listener + * @param {boolean} useCapture + * @param {boolean} passive + * @this {Function} + * @suppressReceiverCheck + */ + function callCustomRemove(type, listener, useCapture, passive) { + this.call(null, type, listener, useCapture, passive); + } + } + + /** + * @return {boolean} + */ + canTogglePassive() { + return this._origin !== SDK.EventListener.Origin.FrameworkUser; + } + + /** + * @return {!Promise<undefined>} + */ + togglePassive() { + return /** @type {!Promise<undefined>} */ (this._eventTarget.callFunctionPromise(callTogglePassive, [ + SDK.RemoteObject.toCallArgument(this._type), + SDK.RemoteObject.toCallArgument(this._originalHandler), + SDK.RemoteObject.toCallArgument(this._useCapture), + SDK.RemoteObject.toCallArgument(this._passive), + ])); + + /** + * @param {string} type + * @param {function()} listener + * @param {boolean} useCapture + * @param {boolean} passive + * @this {Object} + * @suppressReceiverCheck + */ + function callTogglePassive(type, listener, useCapture, passive) { + this.removeEventListener(type, listener, {capture: useCapture}); + this.addEventListener(type, listener, {capture: useCapture, passive: !passive}); + } + } + + /** + * @return {!SDK.EventListener.Origin} + */ + origin() { + return this._origin; + } + + markAsFramework() { + this._origin = SDK.EventListener.Origin.Framework; + } + + /** + * @return {boolean} + */ + isScrollBlockingType() { + return this._type === 'touchstart' || this._type === 'touchmove' || this._type === 'mousewheel' || + this._type === 'wheel'; + } +}; + +/** @enum {string} */ +SDK.EventListener.Origin = { + Raw: 'Raw', + Framework: 'Framework', + FrameworkUser: 'FrameworkUser' +}; + /** * @implements {SDK.SDKModelObserver<!SDK.DOMDebuggerModel>} */
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js index 2e65110..5705f5a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
@@ -313,13 +313,6 @@ } /** - * @return {!Promise<?Array<!SDK.EventListener>>} - */ - eventListeners() { - throw 'Not implemented'; - } - - /** * @param {!Protocol.Runtime.CallArgument} name * @param {function(string=)} callback */ @@ -557,62 +550,6 @@ /** * @override - * @return {!Promise<?Array<!SDK.EventListener>>} - */ - eventListeners() { - return new Promise(eventListeners.bind(this)); - /** - * @param {function(?)} fulfill - * @param {function(*)} reject - * @this {SDK.RemoteObjectImpl} - */ - function eventListeners(fulfill, reject) { - if (!this._runtimeModel.target().hasDOMCapability()) { - // TODO(kozyatinskiy): figure out how this should work for |window| when there is no DOMDebugger. - fulfill([]); - return; - } - - if (!this._objectId) { - reject(new Error('No object id specified')); - return; - } - - this._runtimeModel.target().domdebuggerAgent().getEventListeners( - this._objectId, undefined, undefined, mycallback.bind(this)); - - /** - * @this {SDK.RemoteObjectImpl} - * @param {?Protocol.Error} error - * @param {!Array<!Protocol.DOMDebugger.EventListener>} payloads - */ - function mycallback(error, payloads) { - if (error) { - reject(new Error(error)); - return; - } - fulfill(payloads.map(createEventListener.bind(this))); - } - - /** - * @this {SDK.RemoteObjectImpl} - * @param {!Protocol.DOMDebugger.EventListener} payload - */ - function createEventListener(payload) { - return new SDK.EventListener( - this._runtimeModel, this, payload.type, payload.useCapture, payload.passive, payload.once, - payload.handler ? this._runtimeModel.createRemoteObject(payload.handler) : null, - payload.originalHandler ? this._runtimeModel.createRemoteObject(payload.originalHandler) : null, - /** @type {!SDK.DebuggerModel.Location} */ - (this.debuggerModel().createRawLocationByScriptId( - payload.scriptId, payload.lineNumber, payload.columnNumber)), - null); - } - } - } - - /** - * @override * @param {!Array.<string>} propertyPath * @param {function(?SDK.RemoteObject, boolean=)} callback */
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js index 5932d668..95e2068 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -498,7 +498,6 @@ Load: Symbol('Load'), PageReloadRequested: Symbol('PageReloadRequested'), WillReloadPage: Symbol('WillReloadPage'), - ColorPicked: Symbol('ColorPicked'), InterstitialShown: Symbol('InterstitialShown'), InterstitialHidden: Symbol('InterstitialHidden') }; @@ -870,14 +869,6 @@ /** * @override - * @param {!Protocol.DOM.RGBA} color - */ - colorPicked(color) { - this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ColorPicked, color); - } - - /** - * @override */ interstitialShown() { this._resourceTreeModel._isInterstitialShowing = true;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js index a6da9eb..867e6ab 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -666,216 +666,3 @@ this._label = parsedUrl ? parsedUrl.lastPathComponentWithFragment() : ''; } }; - - -SDK.EventListener = class { - /** - * @param {!SDK.RuntimeModel} runtimeModel - * @param {!SDK.RemoteObject} eventTarget - * @param {string} type - * @param {boolean} useCapture - * @param {boolean} passive - * @param {boolean} once - * @param {?SDK.RemoteObject} handler - * @param {?SDK.RemoteObject} originalHandler - * @param {!SDK.DebuggerModel.Location} location - * @param {?SDK.RemoteObject} customRemoveFunction - * @param {!SDK.EventListener.Origin=} origin - */ - constructor( - runtimeModel, eventTarget, type, useCapture, passive, once, handler, originalHandler, location, - customRemoveFunction, origin) { - this._runtimeModel = runtimeModel; - this._eventTarget = eventTarget; - this._type = type; - this._useCapture = useCapture; - this._passive = passive; - this._once = once; - this._handler = handler; - this._originalHandler = originalHandler || handler; - this._location = location; - var script = location.script(); - this._sourceURL = script ? script.contentURL() : ''; - this._customRemoveFunction = customRemoveFunction; - this._origin = origin || SDK.EventListener.Origin.Raw; - } - - /** - * @return {!SDK.RuntimeModel} - */ - runtimeModel() { - return this._runtimeModel; - } - - /** - * @return {string} - */ - type() { - return this._type; - } - - /** - * @return {boolean} - */ - useCapture() { - return this._useCapture; - } - - /** - * @return {boolean} - */ - passive() { - return this._passive; - } - - /** - * @return {boolean} - */ - once() { - return this._once; - } - - /** - * @return {?SDK.RemoteObject} - */ - handler() { - return this._handler; - } - - /** - * @return {!SDK.DebuggerModel.Location} - */ - location() { - return this._location; - } - - /** - * @return {string} - */ - sourceURL() { - return this._sourceURL; - } - - /** - * @return {?SDK.RemoteObject} - */ - originalHandler() { - return this._originalHandler; - } - - /** - * @return {boolean} - */ - canRemove() { - return !!this._customRemoveFunction || this._origin !== SDK.EventListener.Origin.FrameworkUser; - } - - /** - * @return {!Promise<undefined>} - */ - remove() { - if (!this.canRemove()) - return Promise.resolve(); - - if (this._origin !== SDK.EventListener.Origin.FrameworkUser) { - /** - * @param {string} type - * @param {function()} listener - * @param {boolean} useCapture - * @this {Object} - * @suppressReceiverCheck - */ - function removeListener(type, listener, useCapture) { - this.removeEventListener(type, listener, useCapture); - if (this['on' + type]) - this['on' + type] = undefined; - } - - return /** @type {!Promise<undefined>} */ (this._eventTarget.callFunctionPromise(removeListener, [ - SDK.RemoteObject.toCallArgument(this._type), SDK.RemoteObject.toCallArgument(this._originalHandler), - SDK.RemoteObject.toCallArgument(this._useCapture) - ])); - } - - return this._customRemoveFunction - .callFunctionPromise( - callCustomRemove, - [ - SDK.RemoteObject.toCallArgument(this._type), - SDK.RemoteObject.toCallArgument(this._originalHandler), - SDK.RemoteObject.toCallArgument(this._useCapture), - SDK.RemoteObject.toCallArgument(this._passive), - ]) - .then(() => undefined); - - /** - * @param {string} type - * @param {function()} listener - * @param {boolean} useCapture - * @param {boolean} passive - * @this {Function} - * @suppressReceiverCheck - */ - function callCustomRemove(type, listener, useCapture, passive) { - this.call(null, type, listener, useCapture, passive); - } - } - - /** - * @return {boolean} - */ - canTogglePassive() { - return this._origin !== SDK.EventListener.Origin.FrameworkUser; - } - - /** - * @return {!Promise<undefined>} - */ - togglePassive() { - return /** @type {!Promise<undefined>} */ (this._eventTarget.callFunctionPromise(callTogglePassive, [ - SDK.RemoteObject.toCallArgument(this._type), - SDK.RemoteObject.toCallArgument(this._originalHandler), - SDK.RemoteObject.toCallArgument(this._useCapture), - SDK.RemoteObject.toCallArgument(this._passive), - ])); - - /** - * @param {string} type - * @param {function()} listener - * @param {boolean} useCapture - * @param {boolean} passive - * @this {Object} - * @suppressReceiverCheck - */ - function callTogglePassive(type, listener, useCapture, passive) { - this.removeEventListener(type, listener, {capture: useCapture}); - this.addEventListener(type, listener, {capture: useCapture, passive: !passive}); - } - } - - /** - * @return {!SDK.EventListener.Origin} - */ - origin() { - return this._origin; - } - - markAsFramework() { - this._origin = SDK.EventListener.Origin.Framework; - } - - /** - * @return {boolean} - */ - isScrollBlockingType() { - return this._type === 'touchstart' || this._type === 'touchmove' || this._type === 'mousewheel' || - this._type === 'wheel'; - } -}; - -/** @enum {string} */ -SDK.EventListener.Origin = { - Raw: 'Raw', - Framework: 'Framework', - FrameworkUser: 'FrameworkUser' -};
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js index fa4e168..83e0324 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js
@@ -183,13 +183,6 @@ /** * @override - * @param {!Protocol.DOM.RGBA} color - */ - colorPicked(color) { - } - - /** - * @override */ interstitialShown() { }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js index 6cad69ee..9b28e4e 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
@@ -211,10 +211,11 @@ TouchEmulation: 1 << 8, Security: 1 << 9, Input: 1 << 10, + Inspector: 1 << 11, None: 0, - AllForTests: (1 << 11) - 1 + AllForTests: (1 << 12) - 1 }; /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js index 74f4631..7768d20 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -334,10 +334,10 @@ var capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | SDK.Target.Capability.JS | SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target | SDK.Target.Capability.ScreenCapture | SDK.Target.Capability.Tracing | SDK.Target.Capability.TouchEmulation | - SDK.Target.Capability.Security | SDK.Target.Capability.Input; + SDK.Target.Capability.Security | SDK.Target.Capability.Input | SDK.Target.Capability.Inspector; if (Runtime.queryParam('isSharedWorker')) { capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.Log | SDK.Target.Capability.Network | - SDK.Target.Capability.Target; + SDK.Target.Capability.Target | SDK.Target.Capability.Inspector; } else if (Runtime.queryParam('v8only')) { capabilities = SDK.Target.Capability.JS; Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSDirectly);
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js b/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js index 89f458a..c2e545a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js
@@ -87,10 +87,8 @@ if (subText) { var subElement = messageWrapper.createChild('div', 'status-sub monospace'); subElement.textContent = subText; + subElement.title = title || subText; } - var tooltip = title || subText; - if (tooltip) - messageWrapper.title = tooltip; return messageWrapper; } }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js index fdb10e3c..e0158940 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -514,14 +514,6 @@ /** * @override - * @return {!Promise<?Array<!SDK.EventListener>>} - */ - eventListeners() { - return this._object.eventListeners(); - } - - /** - * @override * @param {!Protocol.Runtime.CallArgument} name * @param {function(string=)} callback */
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/debuggerPausedMessage.css b/third_party/WebKit/Source/devtools/front_end/sources/debuggerPausedMessage.css index b7e8efc4..532b337 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/debuggerPausedMessage.css +++ b/third_party/WebKit/Source/devtools/front_end/sources/debuggerPausedMessage.css
@@ -10,7 +10,6 @@ .paused-status { padding: 6px; - pointer-events: none; border-bottom: 1px solid transparent; border-top: 1px solid rgb(189, 189, 189); background-color: hsl(50, 100%, 95%);
diff --git a/third_party/WebKit/Source/devtools/scripts/build/generate_protocol_externs.py b/third_party/WebKit/Source/devtools/scripts/build/generate_protocol_externs.py index 4680fb9..e81d9796 100755 --- a/third_party/WebKit/Source/devtools/scripts/build/generate_protocol_externs.py +++ b/third_party/WebKit/Source/devtools/scripts/build/generate_protocol_externs.py
@@ -50,6 +50,7 @@ "Animation", "Browser", "CSS", + "DOMDebugger", "Emulation", "HeapProfiler", "Page",
diff --git a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/hashes b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/hashes index e3e1c562..da490d36 100644 --- a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/hashes +++ b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/hashes
@@ -1,2 +1,2 @@ -a6f364723aff924e15308ddd4ba55672a526fe8a2ff7ec47e89a99e7f2c556ac jsdoc_validator.jar -ac321aa5fc60506b95491875072114c5dbfbb72fb24b29b22a287daa626bb3f4 src +82b8b72b201fdeb037f73ba592a9083f54a609437b47d60ee0319fec06f4dcfc jsdoc_validator.jar +8fd603ac1e9ae2ddd90efe8df1a055c4376cbf52dd4b45223826e94b69a2df92 src
diff --git a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/jsdoc_validator.jar b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/jsdoc_validator.jar index 318e81b..bb463740 100644 --- a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/jsdoc_validator.jar +++ b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/jsdoc_validator.jar Binary files differ
diff --git a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/ContextTrackingValidationCheck.java b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/ContextTrackingValidationCheck.java index 9b3ba76..0e42182c 100644 --- a/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/ContextTrackingValidationCheck.java +++ b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/ContextTrackingValidationCheck.java
@@ -130,7 +130,10 @@ Node parametersNode = NodeUtil.getFunctionParameters(functionNode); for (int i = 0, childCount = parametersNode.getChildCount(); i < childCount; ++i) { Node paramNode = parametersNode.getChildAtIndex(i); - String paramName = state.getContext().getNodeText(paramNode); + String paramText = state.getContext().getNodeText(paramNode); + + // Handle default parameters (ES6) + String paramName = paramText.split("=")[0].trim(); parameterNames.add(paramName); } return parameterNames;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp index 21a5d05..be3e301 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
@@ -54,8 +54,12 @@ if (context_options.latencyHint().isAudioContextLatencyCategory()) { latency_hint = WebAudioLatencyHint( context_options.latencyHint().getAsAudioContextLatencyCategory()); + } else if (context_options.latencyHint().isDouble()) { + // This should be the requested output latency in seconds, without taking + // into account double buffering (same as baseLatency). + latency_hint = + WebAudioLatencyHint(context_options.latencyHint().getAsDouble()); } - // TODO: add support for latencyHint().isDouble() AudioContext* audio_context = new AudioContext(document, latency_hint); audio_context->SuspendIfNeeded(); @@ -264,7 +268,7 @@ } double AudioContext::baseLatency() const { - return FramesPerBuffer() * 2 / static_cast<double>(sampleRate()); + return FramesPerBuffer() / static_cast<double>(sampleRate()); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContextOptions.idl b/third_party/WebKit/Source/modules/webaudio/AudioContextOptions.idl index 93f5c40..6fc6a38 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContextOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/AudioContextOptions.idl
@@ -4,5 +4,8 @@ // See https://webaudio.github.io/web-audio-api/#audiocontextoptions dictionary AudioContextOptions { + // If passed as a double this should be the requested output latency in + // seconds, without taking into account double buffering (same as + // AudioContext.baseLatency). (AudioContextLatencyCategory or double) latencyHint = "interactive"; };
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp index 0f2d7fca..9389f7f 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp
@@ -40,15 +40,24 @@ const WebString& device_id, const WebSecurityOrigin&) override { double buffer_size = 0; + const double interactive_size = AudioHardwareBufferSize(); + const double balanced_size = AudioHardwareBufferSize() * 2; + const double playback_size = AudioHardwareBufferSize() * 4; switch (latency_hint.Category()) { case WebAudioLatencyHint::kCategoryInteractive: - buffer_size = AudioHardwareBufferSize(); + buffer_size = interactive_size; break; case WebAudioLatencyHint::kCategoryBalanced: - buffer_size = AudioHardwareBufferSize() * 2; + buffer_size = balanced_size; break; case WebAudioLatencyHint::kCategoryPlayback: - buffer_size = AudioHardwareBufferSize() * 4; + buffer_size = playback_size; + break; + case WebAudioLatencyHint::kCategoryExact: + buffer_size = + clampTo(latency_hint.Seconds() * AudioHardwareSampleRate(), + static_cast<double>(AudioHardwareBufferSize()), + static_cast<double>(playback_size)); break; default: NOTREACHED(); @@ -100,6 +109,34 @@ AudioContext* playback_context = AudioContext::Create( GetDocument(), playback_options, ASSERT_NO_EXCEPTION); EXPECT_GT(playback_context->baseLatency(), balanced_context->baseLatency()); + + AudioContextOptions exact_too_small_options; + exact_too_small_options.setLatencyHint( + AudioContextLatencyCategoryOrDouble::fromDouble( + interactive_context->baseLatency() / 2)); + AudioContext* exact_too_small_context = AudioContext::Create( + GetDocument(), exact_too_small_options, ASSERT_NO_EXCEPTION); + EXPECT_EQ(exact_too_small_context->baseLatency(), + interactive_context->baseLatency()); + + const double exact_latency_sec = + (interactive_context->baseLatency() + playback_context->baseLatency()) / + 2; + AudioContextOptions exact_ok_options; + exact_ok_options.setLatencyHint( + AudioContextLatencyCategoryOrDouble::fromDouble(exact_latency_sec)); + AudioContext* exact_ok_context = AudioContext::Create( + GetDocument(), exact_ok_options, ASSERT_NO_EXCEPTION); + EXPECT_EQ(exact_ok_context->baseLatency(), exact_latency_sec); + + AudioContextOptions exact_too_big_options; + exact_too_big_options.setLatencyHint( + AudioContextLatencyCategoryOrDouble::fromDouble( + playback_context->baseLatency() * 2)); + AudioContext* exact_too_big_context = AudioContext::Create( + GetDocument(), exact_too_big_options, ASSERT_NO_EXCEPTION); + EXPECT_EQ(exact_too_big_context->baseLatency(), + playback_context->baseLatency()); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp b/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp index 274dba2..13c8040 100644 --- a/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp +++ b/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp
@@ -56,8 +56,6 @@ // (depending on the audio hardware) when they are loaded. const float kResponseSampleRate = 44100; -#if USE(CONCATENATED_IMPULSE_RESPONSES) - // This table maps the index into the elevation table with the corresponding // angle. See https://bugs.webkit.org/show_bug.cgi?id=98294#c9 for the // elevation angles and their order in the concatenated response. @@ -103,7 +101,6 @@ return bus; } -#endif bool HRTFElevation::CalculateKernelsForAzimuthElevation( int azimuth, @@ -135,7 +132,6 @@ // implementation detail. int positive_elevation = elevation < 0 ? elevation + 360 : elevation; -#if USE(CONCATENATED_IMPULSE_RESPONSES) RefPtr<AudioBus> bus(GetConcatenatedImpulseResponsesForSubject(subject_name)); if (!bus) @@ -182,33 +178,6 @@ response->Channel(AudioBus::kChannelLeft); AudioChannel* right_ear_impulse_response = response->Channel(AudioBus::kChannelRight); -#else - String resourceName = - String::format("IRC_%s_C_R0195_T%03d_P%03d", subjectName.utf8().data(), - azimuth, positiveElevation); - - RefPtr<AudioBus> impulseResponse( - AudioBus::loadPlatformResource(resourceName.utf8().data(), sampleRate)); - - DCHECK(impulseResponse.get()); - if (!impulseResponse.get()) - return false; - - size_t responseLength = impulseResponse->length(); - size_t expectedLength = static_cast<size_t>(256 * (sampleRate / 44100.0)); - - // Check number of channels and length. For now these are fixed and known. - bool isBusGood = responseLength == expectedLength && - impulseResponse->numberOfChannels() == 2; - DCHECK(isBusGood); - if (!isBusGood) - return false; - - AudioChannel* leftEarImpulseResponse = - impulseResponse->channelByType(AudioBus::ChannelLeft); - AudioChannel* rightEarImpulseResponse = - impulseResponse->channelByType(AudioBus::ChannelRight); -#endif // Note that depending on the fftSize returned by the panner, we may be // truncating the impulse response we just loaded in.
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index 69b457f..98a3a65f 100644 --- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -793,27 +793,24 @@ image_planes_ = std::move(image_planes); } +// At the moment we support only JCS_RGB and JCS_CMYK values of the +// J_COLOR_SPACE enum. +// If you need a specific implementation for other J_COLOR_SPACE values, +// please add a full template specialization for this function below. template <J_COLOR_SPACE colorSpace> -void SetPixel(ImageFrame& buffer, - ImageFrame::PixelData* pixel, - JSAMPARRAY samples, - int column) { - NOTREACHED(); -} +void SetPixel(ImageFrame::PixelData*, JSAMPARRAY samples, int column) = delete; // Used only for debugging with libjpeg (instead of libjpeg-turbo). template <> -void SetPixel<JCS_RGB>(ImageFrame& buffer, - ImageFrame::PixelData* pixel, +void SetPixel<JCS_RGB>(ImageFrame::PixelData* pixel, JSAMPARRAY samples, int column) { JSAMPLE* jsample = *samples + column * 3; - buffer.SetRGBARaw(pixel, jsample[0], jsample[1], jsample[2], 255); + ImageFrame::SetRGBARaw(pixel, jsample[0], jsample[1], jsample[2], 255); } template <> -void SetPixel<JCS_CMYK>(ImageFrame& buffer, - ImageFrame::PixelData* pixel, +void SetPixel<JCS_CMYK>(ImageFrame::PixelData* pixel, JSAMPARRAY samples, int column) { JSAMPLE* jsample = *samples + column * 4; @@ -828,8 +825,8 @@ // From CMY (0..1) to RGB (0..1): // R = 1 - C => 1 - (1 - iC*iK) => iC*iK [G and B similar] unsigned k = jsample[3]; - buffer.SetRGBARaw(pixel, jsample[0] * k / 255, jsample[1] * k / 255, - jsample[2] * k / 255, 255); + ImageFrame::SetRGBARaw(pixel, jsample[0] * k / 255, jsample[1] * k / 255, + jsample[2] * k / 255, 255); } // Used only for JCS_CMYK and JCS_RGB output. Note that JCS_RGB is used only @@ -850,7 +847,7 @@ ImageFrame::PixelData* pixel = buffer.GetAddr(0, y); for (int x = 0; x < width; ++pixel, ++x) - SetPixel<colorSpace>(buffer, pixel, samples, x); + SetPixel<colorSpace>(pixel, samples, x); SkColorSpaceXform* xform = reader->Decoder()->ColorTransform(); if (JCS_RGB == colorSpace && xform) {
diff --git a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp index 7f37ec5..b094cb6 100644 --- a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp +++ b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -393,15 +393,15 @@ if (buffer.PremultiplyAlpha()) { for (auto *dst_pixel = dst_row; dst_pixel < dst_row + width; dst_pixel++, src_ptr += 4) { - buffer.SetRGBAPremultiply(dst_pixel, src_ptr[0], src_ptr[1], - src_ptr[2], src_ptr[3]); + ImageFrame::SetRGBAPremultiply(dst_pixel, src_ptr[0], src_ptr[1], + src_ptr[2], src_ptr[3]); alpha_mask &= src_ptr[3]; } } else { for (auto *dst_pixel = dst_row; dst_pixel < dst_row + width; dst_pixel++, src_ptr += 4) { - buffer.SetRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], src_ptr[2], - src_ptr[3]); + ImageFrame::SetRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], src_ptr[2], + src_ptr[3]); alpha_mask &= src_ptr[3]; } } @@ -413,15 +413,15 @@ if (buffer.PremultiplyAlpha()) { for (auto *dst_pixel = dst_row; dst_pixel < dst_row + width; dst_pixel++, src_ptr += 4) { - buffer.BlendRGBAPremultiplied(dst_pixel, src_ptr[0], src_ptr[1], - src_ptr[2], src_ptr[3]); + ImageFrame::BlendRGBAPremultiplied(dst_pixel, src_ptr[0], src_ptr[1], + src_ptr[2], src_ptr[3]); alpha_mask &= src_ptr[3]; } } else { for (auto *dst_pixel = dst_row; dst_pixel < dst_row + width; dst_pixel++, src_ptr += 4) { - buffer.BlendRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], src_ptr[2], - src_ptr[3]); + ImageFrame::BlendRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], + src_ptr[2], src_ptr[3]); alpha_mask &= src_ptr[3]; } } @@ -433,7 +433,8 @@ } else { for (auto *dst_pixel = dst_row; dst_pixel < dst_row + width; src_ptr += 3, ++dst_pixel) { - buffer.SetRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], src_ptr[2], 255); + ImageFrame::SetRGBARaw(dst_pixel, src_ptr[0], src_ptr[1], src_ptr[2], + 255); } // We'll apply the color space xform to opaque pixels after they have been
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h index 8fd471c..d302289 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
@@ -76,7 +76,7 @@ DECLARE_VIRTUAL_TRACE(); - virtual bool IsLiveContext() { return false; } + virtual bool IsFrameFetchContext() { return false; } virtual void AddAdditionalRequestHeaders(ResourceRequest&, FetchResourceType);
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp index 3954ddc..412f7c3 100644 --- a/third_party/WebKit/Source/web/InspectorOverlay.cpp +++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -193,6 +193,7 @@ show_reloading_blanket_(false), in_layout_(false), needs_update_(false), + swallow_next_mouse_up_(false), inspect_mode_(InspectorDOMAgent::kNotSearching) {} InspectorOverlay::~InspectorOverlay() { @@ -263,7 +264,9 @@ if (mouse_event.GetType() == WebInputEvent::kMouseMove) handled = HandleMouseMove(mouse_event); else if (mouse_event.GetType() == WebInputEvent::kMouseDown) - handled = HandleMousePress(); + handled = HandleMouseDown(); + else if (mouse_event.GetType() == WebInputEvent::kMouseUp) + handled = HandleMouseUp(); if (handled) return true; @@ -766,11 +769,13 @@ return true; } -bool InspectorOverlay::HandleMousePress() { +bool InspectorOverlay::HandleMouseDown() { + swallow_next_mouse_up_ = false; if (!ShouldSearchForNode()) return false; if (hovered_node_for_inspect_mode_) { + swallow_next_mouse_up_ = true; Inspect(hovered_node_for_inspect_mode_.Get()); hovered_node_for_inspect_mode_.Clear(); return true; @@ -778,6 +783,14 @@ return false; } +bool InspectorOverlay::HandleMouseUp() { + if (swallow_next_mouse_up_) { + swallow_next_mouse_up_ = false; + return true; + } + return false; +} + bool InspectorOverlay::HandleGestureEvent(const WebGestureEvent& event) { if (!ShouldSearchForNode() || event.GetType() != WebInputEvent::kGestureTap) return false;
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.h b/third_party/WebKit/Source/web/InspectorOverlay.h index 1678847..6cc0a65 100644 --- a/third_party/WebKit/Source/web/InspectorOverlay.h +++ b/third_party/WebKit/Source/web/InspectorOverlay.h
@@ -131,7 +131,8 @@ void ScheduleUpdate(); void ClearInternal(); - bool HandleMousePress(); + bool HandleMouseDown(); + bool HandleMouseUp(); bool HandleGestureEvent(const WebGestureEvent&); bool HandleTouchEvent(const WebTouchEvent&); bool HandleMouseMove(const WebMouseEvent&); @@ -160,6 +161,7 @@ Member<InspectorDOMAgent> dom_agent_; std::unique_ptr<PageOverlay> page_overlay_; Member<Node> hovered_node_for_inspect_mode_; + bool swallow_next_mouse_up_; InspectorDOMAgent::SearchMode inspect_mode_; std::unique_ptr<InspectorHighlightConfig> inspect_mode_highlight_config_; };
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 8c49fca..6b923d4b 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -116,6 +116,7 @@ #include "core/editing/PlainTextRange.h" #include "core/editing/TextAffinity.h" #include "core/editing/iterators/TextIterator.h" +#include "core/editing/markers/DocumentMarkerController.h" #include "core/editing/serializers/Serialization.h" #include "core/editing/spellcheck/SpellChecker.h" #include "core/frame/FrameView.h" @@ -1114,6 +1115,23 @@ GetFrame()->GetSpellChecker().RemoveSpellingMarkers(); } +void WebLocalFrameImpl::SpellingMarkerOffsetsForTest( + WebVector<unsigned>* offsets) { + Vector<unsigned> result; + const DocumentMarkerVector& document_markers = + GetFrame()->GetDocument()->Markers().Markers(); + for (size_t i = 0; i < document_markers.size(); ++i) + result.push_back(document_markers[i]->StartOffset()); + offsets->Assign(result); +} + +void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords( + const WebVector<WebString>& words) { + Vector<String> converted_words; + converted_words.Append(words.Data(), words.size()); + GetFrame()->RemoveSpellingMarkersUnderWords(converted_words); +} + bool WebLocalFrameImpl::HasSelection() const { WebPluginContainerImpl* plugin_container = PluginContainerFromFrame(GetFrame());
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.h b/third_party/WebKit/Source/web/WebLocalFrameImpl.h index f4b2691c..f92b9fc7 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.h +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
@@ -185,6 +185,9 @@ bool IsSpellCheckingEnabled() const override; void ReplaceMisspelledRange(const WebString&) override; void RemoveSpellingMarkers() override; + void SpellingMarkerOffsetsForTest(WebVector<unsigned>* offsets) override; + void RemoveSpellingMarkersUnderWords( + const WebVector<WebString>& words) override; void SetContentSettingsClient(WebContentSettingsClient*) override; bool HasSelection() const override; WebRange SelectionRange() const override;
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 16ac66b8..af54f9e9 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -45,7 +45,6 @@ #include "core/editing/FrameSelection.h" #include "core/editing/InputMethodController.h" #include "core/editing/iterators/TextIterator.h" -#include "core/editing/markers/DocumentMarkerController.h" #include "core/editing/serializers/HTMLInterchange.h" #include "core/editing/serializers/Serialization.h" #include "core/events/KeyboardEvent.h" @@ -3423,32 +3422,6 @@ return HitTestResultForRootFramePos(point_in_root_frame); } -void WebViewImpl::SpellingMarkerOffsetsForTest(WebVector<unsigned>* offsets) { - Vector<unsigned> result; - for (Frame* frame = page_->MainFrame(); frame; - frame = frame->Tree().TraverseNext()) { - if (!frame->IsLocalFrame()) - continue; - const DocumentMarkerVector& document_markers = - ToLocalFrame(frame)->GetDocument()->Markers().Markers(); - for (size_t i = 0; i < document_markers.size(); ++i) - result.push_back(document_markers[i]->StartOffset()); - } - offsets->Assign(result); -} - -void WebViewImpl::RemoveSpellingMarkersUnderWords( - const WebVector<WebString>& words) { - Vector<String> converted_words; - converted_words.Append(words.Data(), words.size()); - - for (Frame* frame = page_->MainFrame(); frame; - frame = frame->Tree().TraverseNext()) { - if (frame->IsLocalFrame()) - ToLocalFrame(frame)->RemoveSpellingMarkersUnderWords(converted_words); - } -} - void WebViewImpl::SendResizeEventAndRepaint() { // FIXME: This is wrong. The FrameView is responsible sending a resizeEvent // as part of layout. Layout is also responsible for sending invalidations
diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index a22ef37..4b2a880 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h
@@ -225,9 +225,6 @@ WebHitTestResult HitTestResultAt(const WebPoint&) override; WebHitTestResult HitTestResultForTap(const WebPoint&, const WebSize&) override; - void SpellingMarkerOffsetsForTest(WebVector<unsigned>* offsets) override; - void RemoveSpellingMarkersUnderWords( - const WebVector<WebString>& words) override; unsigned long CreateUniqueIdentifierForRequest() override; void EnableDeviceEmulation(const WebDeviceEmulationParams&) override; void DisableDeviceEmulation() override;
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index e9ddd44..e260328 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -6584,7 +6584,7 @@ .ForceInvocationForTesting(); WebVector<unsigned> offsets1; - web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets1); + web_frame->SpellingMarkerOffsetsForTest(&offsets1); EXPECT_EQ(1U, offsets1.size()); Vector<String> words; @@ -6592,7 +6592,7 @@ frame->RemoveSpellingMarkersUnderWords(words); WebVector<unsigned> offsets2; - web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets2); + web_frame->SpellingMarkerOffsetsForTest(&offsets2); EXPECT_EQ(0U, offsets2.size()); } @@ -6669,7 +6669,7 @@ textcheck.Kick(); WebVector<unsigned> offsets; - web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets); + frame->SpellingMarkerOffsetsForTest(&offsets); EXPECT_EQ(0U, offsets.size()); }
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium index 42f26d4..86074792 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium
@@ -83,7 +83,7 @@ Name: wpt-tools - Tools for Web Platform Tests Short Name: wpt-tools URL: https://github.com/w3c/wpt-tools -Version: https://codereview.chromium.org/2671203004 (Also check wpt/WPTHeads) +Version: 08a039c29ebe850edfd38aa650b9e5477e200bd2 (Also check wpt/WPTHeads) License: W3C 3-clause BSD License (http://www.w3.org/Consortium/Legal/2008/03-bsd-license.html) License File: wpt/wpt/tools/LICENSE Security Critical: no
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads index 60937be6..f605e61 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads
@@ -3,3 +3,4 @@ ./tools html5lib 7cce65bbaa78411f98b8b37eeefc9db03c580097 ./tools six 3b6173c833d217ab0186c355804f5925cbcfca47 ./tools wptserve 071c51e26a57300979ad53313970d7247979f6d3 +./tools/lint 08a039c29ebe850edfd38aa650b9e5477e200bd2
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList index 702be73a..bece23fa 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList
@@ -3,6 +3,7 @@ ./config.default.json ./CONTRIBUTING.md ./LICENSE.md +./lint ./manifest ./serve ./serve.py @@ -55,6 +56,9 @@ ./tools/html5lib/LICENSE ./tools/html5lib/README.rst ./tools/LICENSE +./tools/lint/__init__.py +./tools/lint/fnmatch.py +./tools/lint/lint.py ./tools/localpaths.py ./tools/manifest/__init__.py ./tools/manifest/catalog/xhtml.dtd
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/lint b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/lint new file mode 100755 index 0000000..64001d61 --- /dev/null +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/lint
@@ -0,0 +1,11 @@ +#!/usr/bin/env python +import sys + +try: + from tools.lint import lint +except ImportError: + print("tools.lint not found. Did you forget to run " + '"git submodule update --init --recursive"?') + sys.exit(2) + +sys.exit(lint.main())
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/__init__.py new file mode 100644 index 0000000..e5eb5e1 --- /dev/null +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/__init__.py
@@ -0,0 +1 @@ +from . import lint
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/fnmatch.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/fnmatch.py new file mode 100644 index 0000000..2fe3eb0 --- /dev/null +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/fnmatch.py
@@ -0,0 +1,32 @@ +from __future__ import absolute_import + +import fnmatch as _stdlib_fnmatch +import os + + +__all__ = ["fnmatch", "fnmatchcase", "filter", "translate"] + + +def fnmatch(name, pat): + name = os.path.normcase(name) + pat = os.path.normcase(pat) + return fnmatchcase(name, pat) + + +def fnmatchcase(name, pat): + if '?' not in pat and '[' not in pat: + wildcards = pat.count("*") + if wildcards == 0: + return name == pat + elif wildcards == 1 and pat[0] == "*": + return name.endswith(pat[1:]) + elif wildcards == 1 and pat[-1] == "*": + return name.startswith(pat[:-1]) + return _stdlib_fnmatch.fnmatchcase(name, pat) + + +def filter(names, pat): + return [n for n in names if fnmatch(n, pat)] + + +translate = _stdlib_fnmatch.translate
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py new file mode 100644 index 0000000..4b74117 --- /dev/null +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py
@@ -0,0 +1,513 @@ +from __future__ import print_function, unicode_literals + +import abc +import argparse +import ast +import json +import os +import re +import subprocess +import sys + +from collections import defaultdict + +from . import fnmatch +from ..localpaths import repo_root +from ..gitignore.gitignore import PathFilter + +from manifest.sourcefile import SourceFile, meta_re +from six import binary_type, iteritems, itervalues +from six.moves import range + +here = os.path.abspath(os.path.split(__file__)[0]) + +ERROR_MSG = """You must fix all errors; for details on how to fix them, see +https://github.com/w3c/web-platform-tests/blob/master/docs/lint-tool.md + +However, instead of fixing a particular error, it's sometimes +OK to add a line to the lint.whitelist file in the root of the +web-platform-tests directory to make the lint tool ignore it. + +For example, to make the lint tool ignore all '%s' +errors in the %s file, +you could add the following line to the lint.whitelist file. + +%s:%s""" + +def all_git_paths(repo_root): + command_line = ["git", "ls-tree", "-r", "--name-only", "HEAD"] + output = subprocess.check_output(command_line, cwd=repo_root) + for item in output.split("\n"): + yield item + +def all_filesystem_paths(repo_root): + path_filter = PathFilter(repo_root, extras=[".git/*"]) + for dirpath, dirnames, filenames in os.walk(repo_root): + for filename in filenames: + path = os.path.relpath(os.path.join(dirpath, filename), repo_root) + if path_filter(path): + yield path + dirnames[:] = [item for item in dirnames if + path_filter(os.path.relpath(os.path.join(dirpath, item) + "/", + repo_root))] + + +def all_paths(repo_root, ignore_local): + fn = all_git_paths if ignore_local else all_filesystem_paths + for item in fn(repo_root): + yield item + +def check_path_length(repo_root, path, css_mode): + if len(path) + 1 > 150: + return [("PATH LENGTH", "/%s longer than maximum path length (%d > 150)" % (path, len(path) + 1), path, None)] + return [] + + +def check_worker_collision(repo_root, path, css_mode): + endings = [(".any.html", ".any.js"), + (".any.worker.html", ".any.js"), + (".worker.html", ".worker.js")] + for path_ending, generated in endings: + if path.endswith(path_ending): + return [("WORKER COLLISION", + "path ends with %s which collides with generated tests from %s files" % (path_ending, generated), + path, + None)] + return [] + + +def parse_whitelist(f): + """ + Parse the whitelist file given by `f`, and return the parsed structure. + """ + + data = defaultdict(lambda:defaultdict(set)) + ignored_files = set() + + for line in f: + line = line.strip() + if not line or line.startswith("#"): + continue + parts = [item.strip() for item in line.split(":")] + if len(parts) == 2: + parts.append(None) + else: + parts[-1] = int(parts[-1]) + + error_type, file_match, line_number = parts + file_match = os.path.normcase(file_match) + + if error_type == "*": + ignored_files.add(file_match) + else: + data[file_match][error_type].add(line_number) + + return data, ignored_files + + +def filter_whitelist_errors(data, path, errors): + """ + Filter out those errors that are whitelisted in `data`. + """ + + if not errors: + return [] + + whitelisted = [False for item in range(len(errors))] + normpath = os.path.normcase(path) + + for file_match, whitelist_errors in iteritems(data): + if fnmatch.fnmatchcase(normpath, file_match): + for i, (error_type, msg, path, line) in enumerate(errors): + if error_type in whitelist_errors: + allowed_lines = whitelist_errors[error_type] + if None in allowed_lines or line in allowed_lines: + whitelisted[i] = True + + return [item for i, item in enumerate(errors) if not whitelisted[i]] + +class Regexp(object): + pattern = None + file_extensions = None + error = None + _re = None + + def __init__(self): + self._re = re.compile(self.pattern) + + def applies(self, path): + return (self.file_extensions is None or + os.path.splitext(path)[1] in self.file_extensions) + + def search(self, line): + return self._re.search(line) + +class TrailingWhitespaceRegexp(Regexp): + pattern = b"[ \t\f\v]$" + error = "TRAILING WHITESPACE" + description = "Whitespace at EOL" + +class TabsRegexp(Regexp): + pattern = b"^\t" + error = "INDENT TABS" + description = "Tabs used for indentation" + +class CRRegexp(Regexp): + pattern = b"\r$" + error = "CR AT EOL" + description = "CR character in line separator" + +class W3CTestOrgRegexp(Regexp): + pattern = b"w3c\-test\.org" + error = "W3C-TEST.ORG" + description = "External w3c-test.org domain used" + +class Webidl2Regexp(Regexp): + pattern = b"webidl2\.js" + error = "WEBIDL2.JS" + description = "Legacy webidl2.js script used" + +class ConsoleRegexp(Regexp): + pattern = b"console\.[a-zA-Z]+\s*\(" + error = "CONSOLE" + file_extensions = [".html", ".htm", ".js", ".xht", ".xhtml", ".svg"] + description = "Console logging API used" + +class PrintRegexp(Regexp): + pattern = b"print(?:\s|\s*\()" + error = "PRINT STATEMENT" + file_extensions = [".py"] + description = "Print function used" + +regexps = [item() for item in + [TrailingWhitespaceRegexp, + TabsRegexp, + CRRegexp, + W3CTestOrgRegexp, + Webidl2Regexp, + ConsoleRegexp, + PrintRegexp]] + +def check_regexp_line(repo_root, path, f, css_mode): + errors = [] + + applicable_regexps = [regexp for regexp in regexps if regexp.applies(path)] + + for i, line in enumerate(f): + for regexp in applicable_regexps: + if regexp.search(line): + errors.append((regexp.error, regexp.description, path, i+1)) + + return errors + +def check_parsed(repo_root, path, f, css_mode): + source_file = SourceFile(repo_root, path, "/", contents=f.read()) + + errors = [] + + if css_mode or path.startswith("css/"): + if (source_file.type == "support" and + not source_file.name_is_non_test and + not source_file.name_is_reference): + return [("SUPPORT-WRONG-DIR", "Support file not in support directory", path, None)] + + if source_file.name_is_non_test or source_file.name_is_manual: + return [] + + if source_file.markup_type is None: + return [] + + if source_file.root is None: + return [("PARSE-FAILED", "Unable to parse file", path, None)] + + if source_file.type == "manual" and not source_file.name_is_manual: + return [("CONTENT-MANUAL", "Manual test whose filename doesn't end in '-manual'", path, None)] + + if source_file.type == "visual" and not source_file.name_is_visual: + return [("CONTENT-VISUAL", "Visual test whose filename doesn't end in '-visual'", path, None)] + + if len(source_file.timeout_nodes) > 1: + errors.append(("MULTIPLE-TIMEOUT", "More than one meta name='timeout'", path, None)) + + for timeout_node in source_file.timeout_nodes: + timeout_value = timeout_node.attrib.get("content", "").lower() + if timeout_value != "long": + errors.append(("INVALID-TIMEOUT", "Invalid timeout value %s" % timeout_value, path, None)) + + if source_file.testharness_nodes: + if len(source_file.testharness_nodes) > 1: + errors.append(("MULTIPLE-TESTHARNESS", + "More than one <script src='/resources/testharness.js'>", path, None)) + + testharnessreport_nodes = source_file.root.findall(".//{http://www.w3.org/1999/xhtml}script[@src='/resources/testharnessreport.js']") + if not testharnessreport_nodes: + errors.append(("MISSING-TESTHARNESSREPORT", + "Missing <script src='/resources/testharnessreport.js'>", path, None)) + else: + if len(testharnessreport_nodes) > 1: + errors.append(("MULTIPLE-TESTHARNESSREPORT", + "More than one <script src='/resources/testharnessreport.js'>", path, None)) + + testharnesscss_nodes = source_file.root.findall(".//{http://www.w3.org/1999/xhtml}link[@href='/resources/testharness.css']") + if testharnesscss_nodes: + errors.append(("PRESENT-TESTHARNESSCSS", + "Explicit link to testharness.css present", path, None)) + + for element in source_file.variant_nodes: + if "content" not in element.attrib: + errors.append(("VARIANT-MISSING", + "<meta name=variant> missing 'content' attribute", path, None)) + else: + variant = element.attrib["content"] + if variant != "" and variant[0] not in ("?", "#"): + errors.append(("MALFORMED-VARIANT", + "%s <meta name=variant> 'content' attribute must be the empty string or start with '?' or '#'" % path, None)) + + seen_elements = {"timeout": False, + "testharness": False, + "testharnessreport": False} + required_elements = [key for key, value in {"testharness": True, + "testharnessreport": len(testharnessreport_nodes) > 0, + "timeout": len(source_file.timeout_nodes) > 0}.items() + if value] + + for elem in source_file.root.iter(): + if source_file.timeout_nodes and elem == source_file.timeout_nodes[0]: + seen_elements["timeout"] = True + if seen_elements["testharness"]: + errors.append(("LATE-TIMEOUT", + "<meta name=timeout> seen after testharness.js script", path, None)) + + elif elem == source_file.testharness_nodes[0]: + seen_elements["testharness"] = True + + elif testharnessreport_nodes and elem == testharnessreport_nodes[0]: + seen_elements["testharnessreport"] = True + if not seen_elements["testharness"]: + errors.append(("EARLY-TESTHARNESSREPORT", + "testharnessreport.js script seen before testharness.js script", path, None)) + + if all(seen_elements[name] for name in required_elements): + break + + + for element in source_file.root.findall(".//{http://www.w3.org/1999/xhtml}script[@src]"): + src = element.attrib["src"] + for name in ["testharness", "testharnessreport"]: + if "%s.js" % name == src or ("/%s.js" % name in src and src != "/resources/%s.js" % name): + errors.append(("%s-PATH" % name.upper(), "%s.js script seen with incorrect path" % name, path, None)) + + + return errors + +class ASTCheck(object): + __metaclass__ = abc.ABCMeta + error = None + description = None + + @abc.abstractmethod + def check(self, root): + pass + +class OpenModeCheck(ASTCheck): + error = "OPEN-NO-MODE" + description = "File opened without providing an explicit mode (note: binary files must be read with 'b' in the mode flags)" + + def check(self, root): + errors = [] + for node in ast.walk(root): + if isinstance(node, ast.Call): + if hasattr(node.func, "id") and node.func.id in ("open", "file"): + if (len(node.args) < 2 and + all(item.arg != "mode" for item in node.keywords)): + errors.append(node.lineno) + return errors + +ast_checkers = [item() for item in [OpenModeCheck]] + +def check_python_ast(repo_root, path, f, css_mode): + if not path.endswith(".py"): + return [] + + try: + root = ast.parse(f.read()) + except SyntaxError as e: + return [("PARSE-FAILED", "Unable to parse file", path, e.lineno)] + + errors = [] + for checker in ast_checkers: + for lineno in checker.check(root): + errors.append((checker.error, checker.description, path, lineno)) + return errors + + +broken_metadata = re.compile(b"//\s*META:") +def check_script_metadata(repo_root, path, f, css_mode): + if not path.endswith((".worker.js", ".any.js")): + return [] + + done = False + errors = [] + for idx, line in enumerate(f): + assert isinstance(line, binary_type), line + + m = meta_re.match(line) + if m: + key, value = m.groups() + if key == b"timeout": + if value != b"long": + errors.append(("UNKNOWN-TIMEOUT-METADATA", "Unexpected value for timeout metadata", path, idx + 1)) + elif key == b"script": + pass + else: + errors.append(("UNKNOWN-METADATA", "Unexpected kind of metadata", path, idx + 1)) + else: + done = True + + if done: + if meta_re.match(line): + errors.append(("STRAY-METADATA", "Metadata comments should start the file", path, idx + 1)) + elif meta_re.search(line): + errors.append(("INDENTED-METADATA", "Metadata comments should start the line", path, idx + 1)) + elif broken_metadata.search(line): + errors.append(("BROKEN-METADATA", "Metadata comment is not formatted correctly", path, idx + 1)) + + return errors + + +def check_path(repo_root, path, css_mode): + """ + Runs lints that check the file path. + + :param repo_root: the repository root + :param path: the path of the file within the repository + :param css_mode: whether we're in CSS testsuite mode + :returns: a list of errors found in ``path`` + """ + + errors = [] + for path_fn in path_lints: + errors.extend(path_fn(repo_root, path, css_mode)) + return errors + + +def check_file_contents(repo_root, path, f, css_mode): + """ + Runs lints that check the file contents. + + :param repo_root: the repository root + :param path: the path of the file within the repository + :param f: a file-like object with the file contents + :param css_mode: whether we're in CSS testsuite mode + :returns: a list of errors found in ``f`` + """ + + errors = [] + for file_fn in file_lints: + errors.extend(file_fn(repo_root, path, f, css_mode)) + f.seek(0) + return errors + + +def output_errors_text(errors): + for error_type, description, path, line_number in errors: + pos_string = path + if line_number: + pos_string += " %s" % line_number + print("%s: %s %s" % (error_type, pos_string, description)) + +def output_errors_json(errors): + for error_type, error, path, line_number in errors: + print(json.dumps({"path": path, "lineno": line_number, + "rule": error_type, "message": error})) + +def output_error_count(error_count): + if not error_count: + return + + by_type = " ".join("%s: %d" % item for item in error_count.items()) + count = sum(error_count.values()) + if count == 1: + print("There was 1 error (%s)" % (by_type,)) + else: + print("There were %d errors (%s)" % (count, by_type)) + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("paths", nargs="*", + help="List of paths to lint") + parser.add_argument("--json", action="store_true", + help="Output machine-readable JSON format") + parser.add_argument("--ignore-local", action="store_true", + help="Ignore locally added files in the working directory (requires git).") + parser.add_argument("--css-mode", action="store_true", + help="Run CSS testsuite specific lints") + return parser.parse_args() + +def main(force_css_mode=False): + args = parse_args() + paths = args.paths if args.paths else all_paths(repo_root, args.ignore_local) + return lint(repo_root, paths, args.json, force_css_mode or args.css_mode) + +def lint(repo_root, paths, output_json, css_mode): + error_count = defaultdict(int) + last = None + + with open(os.path.join(repo_root, "lint.whitelist")) as f: + whitelist, ignored_files = parse_whitelist(f) + + if output_json: + output_errors = output_errors_json + else: + output_errors = output_errors_text + + def process_errors(path, errors): + """ + Filters and prints the errors, and updates the ``error_count`` object. + + :param path: the path of the file that contains the errors + :param errors: a list of error tuples (error type, message, path, line number) + :returns: ``None`` if there were no errors, or + a tuple of the error type and the path otherwise + """ + + errors = filter_whitelist_errors(whitelist, path, errors) + + if not errors: + return None + + output_errors(errors) + for error_type, error, path, line in errors: + error_count[error_type] += 1 + + return (errors[-1][0], path) + + for path in paths: + abs_path = os.path.join(repo_root, path) + if not os.path.exists(abs_path): + continue + + if any(fnmatch.fnmatch(path, file_match) for file_match in ignored_files): + continue + + errors = check_path(repo_root, path, css_mode) + last = process_errors(path, errors) or last + + if not os.path.isdir(abs_path): + with open(abs_path, 'rb') as f: + errors = check_file_contents(repo_root, path, f, css_mode) + last = process_errors(path, errors) or last + + if not output_json: + output_error_count(error_count) + if error_count: + print(ERROR_MSG % (last[0], last[1], last[0], last[1])) + return sum(itervalues(error_count)) + +path_lints = [check_path_length, check_worker_collision] +file_lints = [check_regexp_line, check_parsed, check_python_ast, check_script_metadata] + +if __name__ == "__main__": + error_count = main() + if error_count > 0: + sys.exit(1)
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index 5c99374..6766533a 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -664,14 +664,8 @@ "grit/blink_resources.h", "blink_resources.pak", ] - if (use_concatenated_impulse_responses) { - grit_flags = [ - "-D", - "use_concatenated_impulse_responses", - ] - } html_min_css = "$blink_core_output_dir/html.css" - grit_flags += [ + grit_flags = [ "-E", "html_min_css=" + rebase_path(html_min_css), ]
diff --git a/third_party/WebKit/public/blink_resources.grd b/third_party/WebKit/public/blink_resources.grd index 28bb8f1..fd8e780 100644 --- a/third_party/WebKit/public/blink_resources.grd +++ b/third_party/WebKit/public/blink_resources.grd
@@ -46,251 +46,7 @@ <include name="IDR_LIST_PICKER_CSS" file="../Source/web/resources/listPicker.css" type="BINDATA" compress="gzip"/> <include name="IDR_LIST_PICKER_JS" file="../Source/web/resources/listPicker.js" type="BINDATA" compress="gzip"/> </if> - <if expr="use_concatenated_impulse_responses"> - <include name="IDR_AUDIO_SPATIALIZATION_COMPOSITE" file="../Source/platform/audio/resources/Composite.flac" type="BINDATA"/> - </if> - <if expr="not use_concatenated_impulse_responses"> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T000_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T000_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T015_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T015_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T030_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T030_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T045_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T045_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T060_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T060_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T075_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T075_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T090_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T090_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T105_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T105_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T120_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T120_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T135_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T135_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T150_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T150_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T165_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T165_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T180_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T180_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T195_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T195_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T210_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T210_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T225_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T225_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T240_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T240_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T255_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T255_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T270_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T270_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T285_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T285_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T300_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T300_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T315_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T315_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T330_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T330_P345.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P000" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P000.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P015" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P015.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P030" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P030.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P045" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P045.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P060" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P060.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P075" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P075.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P090" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P090.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P315" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P315.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P330" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P330.wav" type="BINDATA"/> - <include name="IDR_AUDIO_SPATIALIZATION_T345_P345" file="..\Source\platform\audio\resources\IRC_Composite_C_R0195_T345_P345.wav" type="BINDATA"/> - </if> + <include name="IDR_AUDIO_SPATIALIZATION_COMPOSITE" file="../Source/platform/audio/resources/Composite.flac" type="BINDATA"/> </includes> </release> </grit>
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h index 710a6e3d..2a45bee2 100644 --- a/third_party/WebKit/public/web/WebLocalFrame.h +++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -389,6 +389,11 @@ virtual bool IsSpellCheckingEnabled() const = 0; virtual void RemoveSpellingMarkers() = 0; + // Retrieves a list of spelling markers. + virtual void SpellingMarkerOffsetsForTest(WebVector<unsigned>* offsets) = 0; + virtual void RemoveSpellingMarkersUnderWords( + const WebVector<WebString>& words) = 0; + // Content Settings ------------------------------------------------------- virtual void SetContentSettingsClient(WebContentSettingsClient*) = 0;
diff --git a/third_party/WebKit/public/web/WebView.h b/third_party/WebKit/public/web/WebView.h index e811392b..9013193 100644 --- a/third_party/WebKit/public/web/WebView.h +++ b/third_party/WebKit/public/web/WebView.h
@@ -365,11 +365,6 @@ virtual WebHitTestResult HitTestResultForTap(const WebPoint& tap_point, const WebSize& tap_area) = 0; - // Retrieves a list of spelling markers. - virtual void SpellingMarkerOffsetsForTest(WebVector<unsigned>* offsets) = 0; - virtual void RemoveSpellingMarkersUnderWords( - const WebVector<WebString>& words) = 0; - // Support for resource loading initiated by plugins ------------------- // Returns next unused request identifier which is unique within the
diff --git a/third_party/x86inc/LICENSE b/third_party/x86inc/LICENSE deleted file mode 100644 index 96ab5d5..0000000 --- a/third_party/x86inc/LICENSE +++ /dev/null
@@ -1,34 +0,0 @@ -;***************************************************************************** -;* x86inc.asm -;***************************************************************************** -;* Copyright (C) 2005-2011 x264 project -;* -;* Authors: Loren Merritt <lorenm@u.washington.edu> -;* Anton Mitrofanov <BugMaster@narod.ru> -;* Jason Garrett-Glaser <darkshikari@gmail.com> -;* -;* Permission to use, copy, modify, and/or distribute this software for any -;* purpose with or without fee is hereby granted, provided that the above -;* copyright notice and this permission notice appear in all copies. -;* -;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -;***************************************************************************** - -; This is a header file for the x264ASM assembly language, which uses -; NASM/YASM syntax combined with a large number of macros to provide easy -; abstraction between different calling conventions (x86_32, win64, linux64). -; It also has various other useful features to simplify writing the kind of -; DSP functions that are most often used in x264. - -; Unlike the rest of x264, this file is available under an ISC license, as it -; has significant usefulness outside of x264 and we want it to be available -; to the largest audience possible. Of course, if you modify it for your own -; purposes to add a new feature, we strongly encourage contributing a patch -; as this feature might be useful for others as well. Send patches or ideas -; to x264-devel@videolan.org .
diff --git a/third_party/x86inc/OWNERS b/third_party/x86inc/OWNERS deleted file mode 100644 index a58b742..0000000 --- a/third_party/x86inc/OWNERS +++ /dev/null
@@ -1,2 +0,0 @@ -dalecurtis@chromium.org -wolenetz@chromium.org
diff --git a/third_party/x86inc/README.chromium b/third_party/x86inc/README.chromium deleted file mode 100644 index ebbc6f4..0000000 --- a/third_party/x86inc/README.chromium +++ /dev/null
@@ -1,19 +0,0 @@ -Name: x86inc -Short Name: x264asm abstraction layer -URL: http://git.videolan.org/?p=x264.git;a=blob;f=common/x86/x86inc.asm -Version: 0 -Date: 2011-08-09 -Revision: Customized from http://git.videolan.org/?p=x264.git;a=blob;f=common/x86/x86inc.asm;hb=12f12a268d47b12d9e26f57919c5022e2f234f9d -License: ISC from text in file header. Same text is copied to LICENSE file. -License File: LICENSE -Security Critical: Yes -License Android Compatible: Yes - -Description: -This file implements an asm abstraction layer that supports multiple calling -conventions, and it is used by the yuv_convert_simd_x86 target in media. - -Local Modifications: -Multiple chromium specific modifications have been made to this file. Do a -diff of the current version against the Revision identified, above, to see -the specifics.
diff --git a/third_party/x86inc/x86inc.asm b/third_party/x86inc/x86inc.asm deleted file mode 100644 index 7c57f8f..0000000 --- a/third_party/x86inc/x86inc.asm +++ /dev/null
@@ -1,1004 +0,0 @@ -;***************************************************************************** -;* x86inc.asm -;***************************************************************************** -;* Copyright (C) 2005-2011 x264 project -;* -;* Authors: Loren Merritt <lorenm@u.washington.edu> -;* Anton Mitrofanov <BugMaster@narod.ru> -;* Jason Garrett-Glaser <darkshikari@gmail.com> -;* -;* Permission to use, copy, modify, and/or distribute this software for any -;* purpose with or without fee is hereby granted, provided that the above -;* copyright notice and this permission notice appear in all copies. -;* -;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -;***************************************************************************** - -; This is a header file for the x264ASM assembly language, which uses -; NASM/YASM syntax combined with a large number of macros to provide easy -; abstraction between different calling conventions (x86_32, win64, linux64). -; It also has various other useful features to simplify writing the kind of -; DSP functions that are most often used in x264. - -; Unlike the rest of x264, this file is available under an ISC license, as it -; has significant usefulness outside of x264 and we want it to be available -; to the largest audience possible. Of course, if you modify it for your own -; purposes to add a new feature, we strongly encourage contributing a patch -; as this feature might be useful for others as well. Send patches or ideas -; to x264-devel@videolan.org . - -%ifndef THIRD_PARTY_X86INC_X86INC_ASM_ -%define THIRD_PARTY_X86INC_X86INC_ASM_ - -; TODO(wolenetz): Consider either updating this customized version to base from -; a more recent original, or switching to using third_party/ffmpeg's version of -; this abstraction layer. See http://crbug.com/175029 - -%define program_name ff - -%ifdef ARCH_X86_64 - %ifidn __OUTPUT_FORMAT__,win32 - %define WIN64 - %elifidn __OUTPUT_FORMAT__,win64 - %define WIN64 - %else - %define UNIX64 - %endif -%endif - -%ifdef PREFIX - %define mangle(x) _ %+ x -%else - %define mangle(x) x -%endif - -; FIXME: All of the 64bit asm functions that take a stride as an argument -; via register, assume that the high dword of that register is filled with 0. -; This is true in practice (since we never do any 64bit arithmetic on strides, -; and x264's strides are all positive), but is not guaranteed by the ABI. - -; Name of the .rodata section. -; Kludge: Something on OS X fails to align .rodata even given an align attribute, -; so use a different read-only section. -%ifdef CHROMIUM -%macro SECTION_RODATA 0-1 16 - %ifidn __OUTPUT_FORMAT__,macho64 - SECTION .text align=%1 - %elifidn __OUTPUT_FORMAT__,macho - SECTION .text align=%1 - fakegot: - %elifidn __OUTPUT_FORMAT__,aout - section .text - %else - SECTION .rodata align=%1 - %endif -%endmacro -%else -%macro SECTION_RODATA 0-1 16 - %ifidn __OUTPUT_FORMAT__,aout - section .text - %else - SECTION .rodata align=%1 - %endif -%endmacro -%endif - -; aout does not support align= -%macro SECTION_TEXT 0-1 16 - %ifidn __OUTPUT_FORMAT__,aout - SECTION .text - %else - SECTION .text align=%1 - %endif -%endmacro - -%ifdef WIN64 - %define PIC -%elifndef ARCH_X86_64 -; For chromium we may build PIC code even for 32 bits system. -%ifndef CHROMIUM -; x86_32 doesn't require PIC. -; Some distros prefer shared objects to be PIC, but nothing breaks if -; the code contains a few textrels, so we'll skip that complexity. - %undef PIC -%endif -%endif -%ifdef PIC - default rel -%endif - -; Macros to eliminate most code duplication between x86_32 and x86_64: -; Currently this works only for leaf functions which load all their arguments -; into registers at the start, and make no other use of the stack. Luckily that -; covers most of x264's asm. - -; PROLOGUE: -; %1 = number of arguments. loads them from stack if needed. -; %2 = number of registers used. pushes callee-saved regs if needed. -; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed. -; %4 = list of names to define to registers -; PROLOGUE can also be invoked by adding the same options to cglobal - -; e.g. -; cglobal foo, 2,3,0, dst, src, tmp -; declares a function (foo), taking two args (dst and src) and one local variable (tmp) - -; TODO Some functions can use some args directly from the stack. If they're the -; last args then you can just not declare them, but if they're in the middle -; we need more flexible macro. - -; RET: -; Pops anything that was pushed by PROLOGUE - -; REP_RET: -; Same, but if it doesn't pop anything it becomes a 2-byte ret, for athlons -; which are slow when a normal ret follows a branch. - -; registers: -; rN and rNq are the native-size register holding function argument N -; rNd, rNw, rNb are dword, word, and byte size -; rNm is the original location of arg N (a register or on the stack), dword -; rNmp is native size - -%macro DECLARE_REG 6 - %define r%1q %2 - %define r%1d %3 - %define r%1w %4 - %define r%1b %5 - %define r%1m %6 - %ifid %6 ; i.e. it's a register - %define r%1mp %2 - %elifdef ARCH_X86_64 ; memory - %define r%1mp qword %6 - %else - %define r%1mp dword %6 - %endif - %define r%1 %2 -%endmacro - -%macro DECLARE_REG_SIZE 2 - %define r%1q r%1 - %define e%1q r%1 - %define r%1d e%1 - %define e%1d e%1 - %define r%1w %1 - %define e%1w %1 - %define r%1b %2 - %define e%1b %2 -%ifndef ARCH_X86_64 - %define r%1 e%1 -%endif -%endmacro - -DECLARE_REG_SIZE ax, al -DECLARE_REG_SIZE bx, bl -DECLARE_REG_SIZE cx, cl -DECLARE_REG_SIZE dx, dl -DECLARE_REG_SIZE si, sil -DECLARE_REG_SIZE di, dil -DECLARE_REG_SIZE bp, bpl - -; t# defines for when per-arch register allocation is more complex than just function arguments - -%macro DECLARE_REG_TMP 1-* - %assign %%i 0 - %rep %0 - CAT_XDEFINE t, %%i, r%1 - %assign %%i %%i+1 - %rotate 1 - %endrep -%endmacro - -%macro DECLARE_REG_TMP_SIZE 0-* - %rep %0 - %define t%1q t%1 %+ q - %define t%1d t%1 %+ d - %define t%1w t%1 %+ w - %define t%1b t%1 %+ b - %rotate 1 - %endrep -%endmacro - -DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9 - -%ifdef ARCH_X86_64 - %define gprsize 8 -%else - %define gprsize 4 -%endif - -%macro PUSH 1 - push %1 - %assign stack_offset stack_offset+gprsize -%endmacro - -%macro POP 1 - pop %1 - %assign stack_offset stack_offset-gprsize -%endmacro - -%macro SUB 2 - sub %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset+(%2) - %endif -%endmacro - -%macro ADD 2 - add %1, %2 - %ifidn %1, rsp - %assign stack_offset stack_offset-(%2) - %endif -%endmacro - -%macro movifnidn 2 - %ifnidn %1, %2 - mov %1, %2 - %endif -%endmacro - -%macro movsxdifnidn 2 - %ifnidn %1, %2 - movsxd %1, %2 - %endif -%endmacro - -%macro ASSERT 1 - %if (%1) == 0 - %error assert failed - %endif -%endmacro - -%macro DEFINE_ARGS 0-* - %ifdef n_arg_names - %assign %%i 0 - %rep n_arg_names - CAT_UNDEF arg_name %+ %%i, q - CAT_UNDEF arg_name %+ %%i, d - CAT_UNDEF arg_name %+ %%i, w - CAT_UNDEF arg_name %+ %%i, b - CAT_UNDEF arg_name %+ %%i, m - CAT_UNDEF arg_name, %%i - %assign %%i %%i+1 - %endrep - %endif - - %assign %%i 0 - %rep %0 - %xdefine %1q r %+ %%i %+ q - %xdefine %1d r %+ %%i %+ d - %xdefine %1w r %+ %%i %+ w - %xdefine %1b r %+ %%i %+ b - %xdefine %1m r %+ %%i %+ m - CAT_XDEFINE arg_name, %%i, %1 - %assign %%i %%i+1 - %rotate 1 - %endrep - %assign n_arg_names %%i -%endmacro - -%ifdef WIN64 ; Windows x64 ;================================================= - -DECLARE_REG 0, rcx, ecx, cx, cl, ecx -DECLARE_REG 1, rdx, edx, dx, dl, edx -DECLARE_REG 2, r8, r8d, r8w, r8b, r8d -DECLARE_REG 3, r9, r9d, r9w, r9b, r9d -DECLARE_REG 4, rdi, edi, di, dil, [rsp + stack_offset + 40] -DECLARE_REG 5, rsi, esi, si, sil, [rsp + stack_offset + 48] -DECLARE_REG 6, rax, eax, ax, al, [rsp + stack_offset + 56] -%define r7m [rsp + stack_offset + 64] -%define r8m [rsp + stack_offset + 72] - -%macro LOAD_IF_USED 2 ; reg_id, number_of_args - %if %1 < %2 - mov r%1, [rsp + stack_offset + 8 + %1*8] - %endif -%endmacro - -%macro PROLOGUE 2-4+ 0 ; #args, #regs, #xmm_regs, arg_names... - ASSERT %2 >= %1 - %assign regs_used %2 - ASSERT regs_used <= 7 - %if regs_used > 4 - push r4 - push r5 - %assign stack_offset stack_offset+16 - %endif - WIN64_SPILL_XMM %3 - LOAD_IF_USED 4, %1 - LOAD_IF_USED 5, %1 - LOAD_IF_USED 6, %1 - DEFINE_ARGS %4 -%endmacro - -%macro WIN64_SPILL_XMM 1 - %assign xmm_regs_used %1 - ASSERT xmm_regs_used <= 16 - %if xmm_regs_used > 6 - sub rsp, (xmm_regs_used-6)*16+16 - %assign stack_offset stack_offset+(xmm_regs_used-6)*16+16 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa [rsp + (%%i-6)*16+8], xmm %+ %%i - %endrep - %endif -%endmacro - -%macro WIN64_RESTORE_XMM_INTERNAL 1 - %if xmm_regs_used > 6 - %assign %%i xmm_regs_used - %rep (xmm_regs_used-6) - %assign %%i %%i-1 - movdqa xmm %+ %%i, [%1 + (%%i-6)*16+8] - %endrep - add %1, (xmm_regs_used-6)*16+16 - %endif -%endmacro - -%macro WIN64_RESTORE_XMM 1 - WIN64_RESTORE_XMM_INTERNAL %1 - %assign stack_offset stack_offset-(xmm_regs_used-6)*16+16 - %assign xmm_regs_used 0 -%endmacro - -%macro RET 0 - WIN64_RESTORE_XMM_INTERNAL rsp - %if regs_used > 4 - pop r5 - pop r4 - %endif - ret -%endmacro - -%macro REP_RET 0 - %if regs_used > 4 || xmm_regs_used > 6 - RET - %else - rep ret - %endif -%endmacro - -%elifdef ARCH_X86_64 ; *nix x64 ;============================================= - -DECLARE_REG 0, rdi, edi, di, dil, edi -DECLARE_REG 1, rsi, esi, si, sil, esi -DECLARE_REG 2, rdx, edx, dx, dl, edx -DECLARE_REG 3, rcx, ecx, cx, cl, ecx -DECLARE_REG 4, r8, r8d, r8w, r8b, r8d -DECLARE_REG 5, r9, r9d, r9w, r9b, r9d -DECLARE_REG 6, rax, eax, ax, al, [rsp + stack_offset + 8] -%define r7m [rsp + stack_offset + 16] -%define r8m [rsp + stack_offset + 24] - -%macro LOAD_IF_USED 2 ; reg_id, number_of_args - %if %1 < %2 - mov r%1, [rsp - 40 + %1*8] - %endif -%endmacro - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - ASSERT %2 >= %1 - ASSERT %2 <= 7 - LOAD_IF_USED 6, %1 - DEFINE_ARGS %4 -%endmacro - -%macro RET 0 - ret -%endmacro - -%macro REP_RET 0 - rep ret -%endmacro - -%else ; X86_32 ;============================================================== - -; Begin chromium edits -%ifdef CHROMIUM -; Change the order of registers so we can get the lower 8-bit or the 5th and 6th -; arguments. -DECLARE_REG 0, esi, esi, si, null, [esp + stack_offset + 4] -DECLARE_REG 1, edi, edi, di, null, [esp + stack_offset + 8] -DECLARE_REG 2, ecx, ecx, cx, cl, [esp + stack_offset + 12] -DECLARE_REG 3, edx, edx, dx, dl, [esp + stack_offset + 16] -DECLARE_REG 4, eax, eax, ax, al, [esp + stack_offset + 20] -DECLARE_REG 5, ebx, ebx, bx, bl, [esp + stack_offset + 24] -%else -DECLARE_REG 0, eax, eax, ax, al, [esp + stack_offset + 4] -DECLARE_REG 1, ecx, ecx, cx, cl, [esp + stack_offset + 8] -DECLARE_REG 2, edx, edx, dx, dl, [esp + stack_offset + 12] -DECLARE_REG 3, ebx, ebx, bx, bl, [esp + stack_offset + 16] -DECLARE_REG 4, esi, esi, si, null, [esp + stack_offset + 20] -DECLARE_REG 5, edi, edi, di, null, [esp + stack_offset + 24] -%endif -; End chromium edits -DECLARE_REG 6, ebp, ebp, bp, null, [esp + stack_offset + 28] -%define r7m [esp + stack_offset + 32] -%define r8m [esp + stack_offset + 36] -%define rsp esp - -%macro PUSH_IF_USED 1 ; reg_id - %if %1 < regs_used - push r%1 - %assign stack_offset stack_offset+4 - %endif -%endmacro - -%macro POP_IF_USED 1 ; reg_id - %if %1 < regs_used - pop r%1 - %endif -%endmacro - -%macro LOAD_IF_USED 2 ; reg_id, number_of_args - %if %1 < %2 - mov r%1, [esp + stack_offset + 4 + %1*4] - %endif -%endmacro - -%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names... - ASSERT %2 >= %1 - %assign regs_used %2 - ASSERT regs_used <= 7 -%ifdef CHROMIUM - PUSH_IF_USED 0 - PUSH_IF_USED 1 - PUSH_IF_USED 5 -%else - PUSH_IF_USED 3 - PUSH_IF_USED 4 - PUSH_IF_USED 5 -%endif - PUSH_IF_USED 6 - LOAD_IF_USED 0, %1 - LOAD_IF_USED 1, %1 - LOAD_IF_USED 2, %1 - LOAD_IF_USED 3, %1 - LOAD_IF_USED 4, %1 - LOAD_IF_USED 5, %1 - LOAD_IF_USED 6, %1 - DEFINE_ARGS %4 -%endmacro - -%macro RET 0 - POP_IF_USED 6 -%ifdef CHROMIUM - POP_IF_USED 5 - POP_IF_USED 1 - POP_IF_USED 0 -%else - POP_IF_USED 5 - POP_IF_USED 4 - POP_IF_USED 3 -%endif - ret -%endmacro - -%macro REP_RET 0 - %if regs_used > 3 - RET - %else - rep ret - %endif -%endmacro - -%endif ;====================================================================== - -%ifndef WIN64 -%macro WIN64_SPILL_XMM 1 -%endmacro -%macro WIN64_RESTORE_XMM 1 -%endmacro -%endif - - - -;============================================================================= -; arch-independent part -;============================================================================= - -%assign function_align 16 - -; Symbol prefix for C linkage -%macro cglobal 1-2+ - %xdefine %1 mangle(program_name %+ _ %+ %1) - %xdefine %1.skip_prologue %1 %+ .skip_prologue - %ifidn __OUTPUT_FORMAT__,elf - global %1:function hidden - %else - global %1 - %endif - align function_align - %1: - RESET_MM_PERMUTATION ; not really needed, but makes disassembly somewhat nicer - %assign stack_offset 0 - %if %0 > 1 - PROLOGUE %2 - %endif -%endmacro - -%macro cextern 1 - %xdefine %1 mangle(program_name %+ _ %+ %1) - extern %1 -%endmacro - -;like cextern, but without the prefix -%macro cextern_naked 1 - %xdefine %1 mangle(%1) - extern %1 -%endmacro - -%macro const 2+ - %xdefine %1 mangle(program_name %+ _ %+ %1) - global %1 - %1: %2 -%endmacro - -; This is needed for ELF, otherwise the GNU linker assumes the stack is -; executable by default. -%ifidn __OUTPUT_FORMAT__,elf -SECTION .note.GNU-stack noalloc noexec nowrite progbits -%endif - -; merge mmx and sse* - -%macro CAT_XDEFINE 3 - %xdefine %1%2 %3 -%endmacro - -%macro CAT_UNDEF 2 - %undef %1%2 -%endmacro - -%macro INIT_MMX 0 - %assign avx_enabled 0 - %define RESET_MM_PERMUTATION INIT_MMX - %define mmsize 8 - %define num_mmregs 8 - %define mova movq - %define movu movq - %define movh movd - %define movnta movntq - %assign %%i 0 - %rep 8 - CAT_XDEFINE m, %%i, mm %+ %%i - CAT_XDEFINE nmm, %%i, %%i - %assign %%i %%i+1 - %endrep - %rep 8 - CAT_UNDEF m, %%i - CAT_UNDEF nmm, %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro INIT_XMM 0 - %assign avx_enabled 0 - %define RESET_MM_PERMUTATION INIT_XMM - %define mmsize 16 - %define num_mmregs 8 - %ifdef ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova movdqa - %define movu movdqu - %define movh movq - %define movnta movntdq - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, xmm %+ %%i - CAT_XDEFINE nxmm, %%i, %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro INIT_AVX 0 - INIT_XMM - %assign avx_enabled 1 - %define PALIGNR PALIGNR_SSSE3 - %define RESET_MM_PERMUTATION INIT_AVX -%endmacro - -%macro INIT_YMM 0 - %assign avx_enabled 1 - %define RESET_MM_PERMUTATION INIT_YMM - %define mmsize 32 - %define num_mmregs 8 - %ifdef ARCH_X86_64 - %define num_mmregs 16 - %endif - %define mova vmovaps - %define movu vmovups - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, ymm %+ %%i - CAT_XDEFINE nymm, %%i, %%i - %assign %%i %%i+1 - %endrep -%endmacro - -INIT_MMX - -; I often want to use macros that permute their arguments. e.g. there's no -; efficient way to implement butterfly or transpose or dct without swapping some -; arguments. -; -; I would like to not have to manually keep track of the permutations: -; If I insert a permutation in the middle of a function, it should automatically -; change everything that follows. For more complex macros I may also have multiple -; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations. -; -; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that -; permutes its arguments. It's equivalent to exchanging the contents of the -; registers, except that this way you exchange the register names instead, so it -; doesn't cost any cycles. - -%macro PERMUTE 2-* ; takes a list of pairs to swap -%rep %0/2 - %xdefine tmp%2 m%2 - %xdefine ntmp%2 nm%2 - %rotate 2 -%endrep -%rep %0/2 - %xdefine m%1 tmp%2 - %xdefine nm%1 ntmp%2 - %undef tmp%2 - %undef ntmp%2 - %rotate 2 -%endrep -%endmacro - -%macro SWAP 2-* ; swaps a single chain (sometimes more concise than pairs) -%rep %0-1 -%ifdef m%1 - %xdefine tmp m%1 - %xdefine m%1 m%2 - %xdefine m%2 tmp - CAT_XDEFINE n, m%1, %1 - CAT_XDEFINE n, m%2, %2 -%else - ; If we were called as "SWAP m0,m1" rather than "SWAP 0,1" infer the original numbers here. - ; Be careful using this mode in nested macros though, as in some cases there may be - ; other copies of m# that have already been dereferenced and don't get updated correctly. - %xdefine %%n1 n %+ %1 - %xdefine %%n2 n %+ %2 - %xdefine tmp m %+ %%n1 - CAT_XDEFINE m, %%n1, m %+ %%n2 - CAT_XDEFINE m, %%n2, tmp - CAT_XDEFINE n, m %+ %%n1, %%n1 - CAT_XDEFINE n, m %+ %%n2, %%n2 -%endif - %undef tmp - %rotate 1 -%endrep -%endmacro - -; If SAVE_MM_PERMUTATION is placed at the end of a function and given the -; function name, then any later calls to that function will automatically -; load the permutation, so values can be returned in mmregs. -%macro SAVE_MM_PERMUTATION 1 ; name to save as - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE %1_m, %%i, m %+ %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro LOAD_MM_PERMUTATION 1 ; name to load from - %assign %%i 0 - %rep num_mmregs - CAT_XDEFINE m, %%i, %1_m %+ %%i - CAT_XDEFINE n, m %+ %%i, %%i - %assign %%i %%i+1 - %endrep -%endmacro - -%macro call 1 - call %1 - %ifdef %1_m0 - LOAD_MM_PERMUTATION %1 - %endif -%endmacro - -; Substitutions that reduce instruction size but are functionally equivalent -%macro add 2 - %ifnum %2 - %if %2==128 - sub %1, -128 - %else - add %1, %2 - %endif - %else - add %1, %2 - %endif -%endmacro - -%macro sub 2 - %ifnum %2 - %if %2==128 - add %1, -128 - %else - sub %1, %2 - %endif - %else - sub %1, %2 - %endif -%endmacro - -;============================================================================= -; AVX abstraction layer -;============================================================================= - -%assign i 0 -%rep 16 - %if i < 8 - CAT_XDEFINE sizeofmm, i, 8 - %endif - CAT_XDEFINE sizeofxmm, i, 16 - CAT_XDEFINE sizeofymm, i, 32 -%assign i i+1 -%endrep -%undef i - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 0 if 3-operand (xmm, xmm, xmm), 1 if 4-operand (xmm, xmm, xmm, imm) -;%4 == number of operands given -;%5+: operands -%macro RUN_AVX_INSTR 6-7+ - %if sizeof%5==32 - v%1 %5, %6, %7 - %else - %if sizeof%5==8 - %define %%regmov movq - %elif %2 - %define %%regmov movaps - %else - %define %%regmov movdqa - %endif - - %if %4>=3+%3 - %ifnidn %5, %6 - %if avx_enabled && sizeof%5==16 - v%1 %5, %6, %7 - %else - %%regmov %5, %6 - %1 %5, %7 - %endif - %else - %1 %5, %7 - %endif - %elif %3 - %1 %5, %6, %7 - %else - %1 %5, %6 - %endif - %endif -%endmacro - -;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 0 if 3-operand (xmm, xmm, xmm), 1 if 4-operand (xmm, xmm, xmm, imm) -%macro AVX_INSTR 3 - %macro %1 2-8 fnord, fnord, fnord, %1, %2, %3 - %ifidn %3, fnord - RUN_AVX_INSTR %6, %7, %8, 2, %1, %2 - %elifidn %4, fnord - RUN_AVX_INSTR %6, %7, %8, 3, %1, %2, %3 - %elifidn %5, fnord - RUN_AVX_INSTR %6, %7, %8, 4, %1, %2, %3, %4 - %else - RUN_AVX_INSTR %6, %7, %8, 5, %1, %2, %3, %4, %5 - %endif - %endmacro -%endmacro - -AVX_INSTR addpd, 1, 0 -AVX_INSTR addps, 1, 0 -AVX_INSTR addsd, 1, 0 -AVX_INSTR addss, 1, 0 -AVX_INSTR addsubpd, 1, 0 -AVX_INSTR addsubps, 1, 0 -AVX_INSTR andpd, 1, 0 -AVX_INSTR andps, 1, 0 -AVX_INSTR andnpd, 1, 0 -AVX_INSTR andnps, 1, 0 -AVX_INSTR blendpd, 1, 0 -AVX_INSTR blendps, 1, 0 -AVX_INSTR blendvpd, 1, 0 -AVX_INSTR blendvps, 1, 0 -AVX_INSTR cmppd, 1, 0 -AVX_INSTR cmpps, 1, 0 -AVX_INSTR cmpsd, 1, 0 -AVX_INSTR cmpss, 1, 0 -AVX_INSTR divpd, 1, 0 -AVX_INSTR divps, 1, 0 -AVX_INSTR divsd, 1, 0 -AVX_INSTR divss, 1, 0 -AVX_INSTR dppd, 1, 0 -AVX_INSTR dpps, 1, 0 -AVX_INSTR haddpd, 1, 0 -AVX_INSTR haddps, 1, 0 -AVX_INSTR hsubpd, 1, 0 -AVX_INSTR hsubps, 1, 0 -AVX_INSTR maxpd, 1, 0 -AVX_INSTR maxps, 1, 0 -AVX_INSTR maxsd, 1, 0 -AVX_INSTR maxss, 1, 0 -AVX_INSTR minpd, 1, 0 -AVX_INSTR minps, 1, 0 -AVX_INSTR minsd, 1, 0 -AVX_INSTR minss, 1, 0 -AVX_INSTR mpsadbw, 0, 1 -AVX_INSTR mulpd, 1, 0 -AVX_INSTR mulps, 1, 0 -AVX_INSTR mulsd, 1, 0 -AVX_INSTR mulss, 1, 0 -AVX_INSTR orpd, 1, 0 -AVX_INSTR orps, 1, 0 -AVX_INSTR packsswb, 0, 0 -AVX_INSTR packssdw, 0, 0 -AVX_INSTR packuswb, 0, 0 -AVX_INSTR packusdw, 0, 0 -AVX_INSTR paddb, 0, 0 -AVX_INSTR paddw, 0, 0 -AVX_INSTR paddd, 0, 0 -AVX_INSTR paddq, 0, 0 -AVX_INSTR paddsb, 0, 0 -AVX_INSTR paddsw, 0, 0 -AVX_INSTR paddusb, 0, 0 -AVX_INSTR paddusw, 0, 0 -AVX_INSTR palignr, 0, 1 -AVX_INSTR pand, 0, 0 -AVX_INSTR pandn, 0, 0 -AVX_INSTR pavgb, 0, 0 -AVX_INSTR pavgw, 0, 0 -AVX_INSTR pblendvb, 0, 0 -AVX_INSTR pblendw, 0, 1 -AVX_INSTR pcmpestri, 0, 0 -AVX_INSTR pcmpestrm, 0, 0 -AVX_INSTR pcmpistri, 0, 0 -AVX_INSTR pcmpistrm, 0, 0 -AVX_INSTR pcmpeqb, 0, 0 -AVX_INSTR pcmpeqw, 0, 0 -AVX_INSTR pcmpeqd, 0, 0 -AVX_INSTR pcmpeqq, 0, 0 -AVX_INSTR pcmpgtb, 0, 0 -AVX_INSTR pcmpgtw, 0, 0 -AVX_INSTR pcmpgtd, 0, 0 -AVX_INSTR pcmpgtq, 0, 0 -AVX_INSTR phaddw, 0, 0 -AVX_INSTR phaddd, 0, 0 -AVX_INSTR phaddsw, 0, 0 -AVX_INSTR phsubw, 0, 0 -AVX_INSTR phsubd, 0, 0 -AVX_INSTR phsubsw, 0, 0 -AVX_INSTR pmaddwd, 0, 0 -AVX_INSTR pmaddubsw, 0, 0 -AVX_INSTR pmaxsb, 0, 0 -AVX_INSTR pmaxsw, 0, 0 -AVX_INSTR pmaxsd, 0, 0 -AVX_INSTR pmaxub, 0, 0 -AVX_INSTR pmaxuw, 0, 0 -AVX_INSTR pmaxud, 0, 0 -AVX_INSTR pminsb, 0, 0 -AVX_INSTR pminsw, 0, 0 -AVX_INSTR pminsd, 0, 0 -AVX_INSTR pminub, 0, 0 -AVX_INSTR pminuw, 0, 0 -AVX_INSTR pminud, 0, 0 -AVX_INSTR pmulhuw, 0, 0 -AVX_INSTR pmulhrsw, 0, 0 -AVX_INSTR pmulhw, 0, 0 -AVX_INSTR pmullw, 0, 0 -AVX_INSTR pmulld, 0, 0 -AVX_INSTR pmuludq, 0, 0 -AVX_INSTR pmuldq, 0, 0 -AVX_INSTR por, 0, 0 -AVX_INSTR psadbw, 0, 0 -AVX_INSTR pshufb, 0, 0 -AVX_INSTR psignb, 0, 0 -AVX_INSTR psignw, 0, 0 -AVX_INSTR psignd, 0, 0 -AVX_INSTR psllw, 0, 0 -AVX_INSTR pslld, 0, 0 -AVX_INSTR psllq, 0, 0 -AVX_INSTR pslldq, 0, 0 -AVX_INSTR psraw, 0, 0 -AVX_INSTR psrad, 0, 0 -AVX_INSTR psrlw, 0, 0 -AVX_INSTR psrld, 0, 0 -AVX_INSTR psrlq, 0, 0 -AVX_INSTR psrldq, 0, 0 -AVX_INSTR psubb, 0, 0 -AVX_INSTR psubw, 0, 0 -AVX_INSTR psubd, 0, 0 -AVX_INSTR psubq, 0, 0 -AVX_INSTR psubsb, 0, 0 -AVX_INSTR psubsw, 0, 0 -AVX_INSTR psubusb, 0, 0 -AVX_INSTR psubusw, 0, 0 -AVX_INSTR punpckhbw, 0, 0 -AVX_INSTR punpckhwd, 0, 0 -AVX_INSTR punpckhdq, 0, 0 -AVX_INSTR punpckhqdq, 0, 0 -AVX_INSTR punpcklbw, 0, 0 -AVX_INSTR punpcklwd, 0, 0 -AVX_INSTR punpckldq, 0, 0 -AVX_INSTR punpcklqdq, 0, 0 -AVX_INSTR pxor, 0, 0 -AVX_INSTR shufps, 0, 1 -AVX_INSTR subpd, 1, 0 -AVX_INSTR subps, 1, 0 -AVX_INSTR subsd, 1, 0 -AVX_INSTR subss, 1, 0 -AVX_INSTR unpckhpd, 1, 0 -AVX_INSTR unpckhps, 1, 0 -AVX_INSTR unpcklpd, 1, 0 -AVX_INSTR unpcklps, 1, 0 -AVX_INSTR xorpd, 1, 0 -AVX_INSTR xorps, 1, 0 - -; 3DNow instructions, for sharing code between AVX, SSE and 3DN -AVX_INSTR pfadd, 1, 0 -AVX_INSTR pfsub, 1, 0 -AVX_INSTR pfmul, 1, 0 - -;============================================================================= -; Chromium extensions -;============================================================================= - -%ifdef CHROMIUM -; Always build PIC code on Mac or Linux for Chromium. -%ifdef MACHO -%define PIC -%endif -%ifdef ELF -%define PIC -%endif - -; -; LOAD_SYM %1 (reg), %2 (sym) -; Copies the address to a local symbol to the specified register. -; - -%macro LOAD_SYM 2 - -%ifdef PIC - call %%geteip - add %1, %2 - $ - jmp %%end -%%geteip: - mov %1, [rsp] - ret -%%end: - -%else - lea %1, [%2] -%endif - -%endmacro - -; -; MOVq %1 (xmm), %2 (reg) -; MOVq %1 (reg), %2 (xmm) -; Copies a general-purpose register to an XMM register, and vice versa. -; -%macro MOVq 2 -%if gprsize == 8 - movq %1, %2 -%else - movd %1, %2 -%endif -%endmacro - -%endif ; CHROMIUM - -%endif ; THIRD_PARTY_X86INC_X86INC_ASM_
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 40051f6..af2b34a 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -87,6 +87,7 @@ DIA_DLL = { '2013': 'msdia120.dll', '2015': 'msdia140.dll', + '2017': 'msdia140.dll', }
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index f8ce2d3..1a461ef 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -81807,6 +81807,26 @@ </summary> </histogram> +<histogram name="WinJumplistUpdater.AddCustomCategoryDuration" units="ms"> + <owner>chengx@chromium.org</owner> + <summary>Time spent in JumpListUpdater::AddCustomCategory.</summary> +</histogram> + +<histogram name="WinJumplistUpdater.AddTasksDuration" units="ms"> + <owner>chengx@chromium.org</owner> + <summary>Time spent in JumpListUpdater::AddTasks.</summary> +</histogram> + +<histogram name="WinJumplistUpdater.BeginUpdateDuration" units="ms"> + <owner>chengx@chromium.org</owner> + <summary>Time spent in JumpListUpdater::BeginUpdate.</summary> +</histogram> + +<histogram name="WinJumplistUpdater.CommitUpdateDuration" units="ms"> + <owner>chengx@chromium.org</owner> + <summary>Time spent in JumpListUpdater::CommitUpdate.</summary> +</histogram> + <histogram name="WinTimeTicks.FailedToChangeCores" enum="WindowsVersion"> <obsolete> Removed 01/2017.
diff --git a/tools/perf/chrome_telemetry_build/chromium_config.py b/tools/perf/chrome_telemetry_build/chromium_config.py index a39dca92..dcbc7b86 100644 --- a/tools/perf/chrome_telemetry_build/chromium_config.py +++ b/tools/perf/chrome_telemetry_build/chromium_config.py
@@ -2,25 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import logging import os -import sys - -def GetChromiumSrcDir(): - return os.path.abspath( - os.path.join(os.path.abspath(__file__), '..', '..', '..', '..')) - - -def GetTelemetryDir(): - return os.path.join(GetChromiumSrcDir(), 'third_party', 'catapult', - 'telemetry') +from core import path_util CLIENT_CONFIG_PATH = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'binary_dependencies.json') -sys.path.insert(1, os.path.join(GetTelemetryDir())) +path_util.AddTelemetryToPath() from telemetry import project_config @@ -28,20 +18,11 @@ class ChromiumConfig(project_config.ProjectConfig): def __init__(self, top_level_dir=None, benchmark_dirs=None, - client_configs=None, - default_chrome_root=GetChromiumSrcDir()): + client_configs=None, default_chrome_root=None): if client_configs is None: client_configs = [CLIENT_CONFIG_PATH] - - perf_dir = os.path.join(GetChromiumSrcDir(), 'tools', 'perf') - if not benchmark_dirs: - benchmark_dirs = [os.path.join(perf_dir, 'benchmarks')] - logging.info('No benchmark directories specified. Defaulting to %s', - benchmark_dirs) - if not top_level_dir: - top_level_dir = perf_dir - logging.info('No top level directory specified. Defaulting to %s', - top_level_dir) + if default_chrome_root is None: + default_chrome_root = path_util.GetChromiumSrcDir() super(ChromiumConfig, self).__init__( top_level_dir=top_level_dir, benchmark_dirs=benchmark_dirs,
diff --git a/tools/perf/core/path_util.py b/tools/perf/core/path_util.py index 27ea09c1..dcfcd08 100644 --- a/tools/perf/core/path_util.py +++ b/tools/perf/core/path_util.py
@@ -5,18 +5,15 @@ import os import sys -sys.path.insert(1, os.path.join(os.path.abspath(__file__), '..', '..')) - -from chrome_telemetry_build import chromium_config - def GetChromiumSrcDir(): - return chromium_config.GetChromiumSrcDir() - + return os.path.abspath(os.path.join( + os.path.dirname(__file__), '..', '..', '..')) def GetTelemetryDir(): - return chromium_config.GetTelemetryDir() + return os.path.join( + GetChromiumSrcDir(), 'third_party', 'catapult', 'telemetry') def GetPerfDir():
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index b4b42eca..b48d440 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -16,9 +16,9 @@ import sys import sets -from chrome_telemetry_build import chromium_config +from core import path_util +path_util.AddTelemetryToPath() -sys.path.append(chromium_config.GetTelemetryDir()) from telemetry import benchmark as benchmark_module from telemetry import decorators from telemetry.core import discover
diff --git a/tools/perf/page_sets/data/system_health_mobile.json b/tools/perf/page_sets/data/system_health_mobile.json index e15b73f7..42ece62 100644 --- a/tools/perf/page_sets/data/system_health_mobile.json +++ b/tools/perf/page_sets/data/system_health_mobile.json
@@ -15,6 +15,12 @@ "background:tools:gmail": { "DEFAULT": "system_health_mobile_043.wpr" }, + "browse:chrome:newtab": { + "DEFAULT": "system_health_mobile_056.wpr" + }, + "browse:chrome:omnibox": { + "DEFAULT": "system_health_mobile_056.wpr" + }, "browse:media:facebook_photos": { "DEFAULT": "system_health_mobile_040.wpr" }, @@ -27,9 +33,15 @@ "browse:news:cnn": { "DEFAULT": "system_health_mobile_014.wpr" }, + "browse:news:cricbuzz": { + "DEFAULT": "system_health_mobile_055.wpr" + }, "browse:news:flipboard": { "DEFAULT": "system_health_mobile_025.wpr" }, + "browse:news:globo": { + "DEFAULT": "system_health_mobile_055.wpr" + }, "browse:news:hackernews": { "DEFAULT": "system_health_mobile_016.wpr" }, @@ -42,15 +54,36 @@ "browse:news:reddit": { "DEFAULT": "system_health_mobile_027.wpr" }, + "browse:news:toi": { + "DEFAULT": "system_health_mobile_055.wpr" + }, "browse:news:washingtonpost": { "DEFAULT": "system_health_mobile_021.wpr" }, + "browse:shopping:amazon": { + "DEFAULT": "system_health_mobile_053.wpr" + }, + "browse:shopping:avito": { + "DEFAULT": "system_health_mobile_053.wpr" + }, + "browse:shopping:flipkart": { + "DEFAULT": "system_health_mobile_061.wpr" + }, + "browse:shopping:lazada": { + "DEFAULT": "system_health_mobile_053.wpr" + }, "browse:social:facebook": { "DEFAULT": "system_health_mobile_028.wpr" }, + "browse:social:instagram": { + "DEFAULT": "system_health_mobile_060.wpr" + }, "browse:social:twitter": { "DEFAULT": "system_health_mobile_023.wpr" }, + "browse:tools:maps": { + "DEFAULT": "system_health_mobile_059.wpr" + }, "load:games:bubbles": { "DEFAULT": "system_health_mobile_005.wpr" }, @@ -96,6 +129,9 @@ "load:news:hackernews": { "DEFAULT": "system_health_mobile_008.wpr" }, + "load:news:irctc": { + "DEFAULT": "system_health_mobile_058.wpr" + }, "load:news:nytimes": { "DEFAULT": "system_health_mobile_009.wpr" }, @@ -183,4 +219,4 @@ }, "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.", "platform_specific": true -} +} \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_053.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_053.wpr.sha1 new file mode 100644 index 0000000..9770556 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_053.wpr.sha1
@@ -0,0 +1 @@ +001da0e4ba7f6618bd6efa4d367855ce61732b24 \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_055.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_055.wpr.sha1 new file mode 100644 index 0000000..ecebe9b --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_055.wpr.sha1
@@ -0,0 +1 @@ +d64c7abe22c189daffb3b6c3dd756d4c7ab275d5 \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_056.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_056.wpr.sha1 new file mode 100644 index 0000000..36c128d --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_056.wpr.sha1
@@ -0,0 +1 @@ +32345576923d7120a04497fc53c9b62f73ff6e32 \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_058.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_058.wpr.sha1 new file mode 100644 index 0000000..d57c92f --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_058.wpr.sha1
@@ -0,0 +1 @@ +303f12fd95c1bf6f261a45d296cb767d1bf99064 \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_059.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_059.wpr.sha1 new file mode 100644 index 0000000..720f2364 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_059.wpr.sha1
@@ -0,0 +1 @@ +0efb76b6711dd621240140b50f0f96300541689c \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_060.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_060.wpr.sha1 new file mode 100644 index 0000000..8c331c3 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_060.wpr.sha1
@@ -0,0 +1 @@ +1c49438de99cb8957e948269aeb306d452e2fc4d \ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile_061.wpr.sha1 b/tools/perf/page_sets/data/system_health_mobile_061.wpr.sha1 new file mode 100644 index 0000000..33ac293 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_mobile_061.wpr.sha1
@@ -0,0 +1 @@ +4a7758fcbadbe1f78d91bdc272aa6782a261f0bd \ No newline at end of file
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index 38a58b7..e8a3c98 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -51,19 +51,14 @@ self._WaitForNavigation(action_runner) -############################################################################## -# News browsing stories. -############################################################################## +class _ArticleBrowsingStory(_BrowsingStory): + """Abstract base class for user stories browsing news / shopping articles. - -class _NewsBrowsingStory(_BrowsingStory): - """Abstract base class for news user stories. - - A news story imitates browsing a news website: + An article browsing story imitates browsing a articles: 1. Load the main page. - 2. Open and scroll the first news item. + 2. Open and scroll the first article. 3. Go back to the main page and scroll it. - 4. Open and scroll the second news item. + 4. Open and scroll the second article. 5. Go back to the main page and scroll it. 6. etc. """ @@ -77,11 +72,11 @@ def _DidLoadDocument(self, action_runner): for i in xrange(self.ITEMS_TO_VISIT): self._NavigateToItem(action_runner, i) - self._ReadNewsItem(action_runner) + self._ReadNextArticle(action_runner) self._NavigateBack(action_runner) self._ScrollMainPage(action_runner) - def _ReadNewsItem(self, action_runner): + def _ReadNextArticle(self, action_runner): action_runner.tab.WaitForDocumentReadyStateToBeComplete() action_runner.Wait(self.ITEM_READ_TIME_IN_SECONDS/2.0) action_runner.RepeatableBrowserDrivenScroll( @@ -94,7 +89,12 @@ repeat_count=self.MAIN_PAGE_SCROLL_REPEAT) -class CnnStory(_NewsBrowsingStory): +############################################################################## +# News browsing stories. +############################################################################## + + +class CnnStory(_ArticleBrowsingStory): """The second top website in http://www.alexa.com/topsites/category/News""" NAME = 'browse:news:cnn' URL = 'http://edition.cnn.com/' @@ -103,7 +103,7 @@ TAGS = [story_tags.JAVASCRIPT_HEAVY] -class FacebookMobileStory(_NewsBrowsingStory): +class FacebookMobileStory(_ArticleBrowsingStory): NAME = 'browse:social:facebook' URL = 'https://www.facebook.com/rihanna' ITEM_SELECTOR = 'article ._5msj' @@ -111,9 +111,10 @@ # (crbug.com/631022) MAIN_PAGE_SCROLL_REPEAT = 1 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] -class FacebookDesktopStory(_NewsBrowsingStory): +class FacebookDesktopStory(_ArticleBrowsingStory): NAME = 'browse:social:facebook' URL = 'https://www.facebook.com/rihanna' ITEM_SELECTOR = '._4-eo' @@ -123,7 +124,23 @@ SUPPORTED_PLATFORMS = platforms.NO_PLATFORMS -class FlipboardMobileStory(_NewsBrowsingStory): +class InstagramMobileStory(_ArticleBrowsingStory): + NAME = 'browse:social:instagram' + URL = 'https://www.instagram.com/badgalriri/' + ITEM_SELECTOR = '[class=\\"_8mlbc _vbtk2 _t5r8b\\"]' + ITEMS_TO_VISIT = 8 + + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + def _WaitForNavigation(self, action_runner): + action_runner.WaitForElement(text='load more comments') + + def _NavigateBack(self, action_runner): + action_runner.NavigateBack() + + +class FlipboardMobileStory(_ArticleBrowsingStory): NAME = 'browse:news:flipboard' URL = 'https://flipboard.com/explore' IS_SINGLE_PAGE_APP = True @@ -132,7 +149,7 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY -class FlipboardDesktopStory(_NewsBrowsingStory): +class FlipboardDesktopStory(_ArticleBrowsingStory): NAME = 'browse:news:flipboard' URL = 'https://flipboard.com/explore' IS_SINGLE_PAGE_APP = True @@ -142,13 +159,13 @@ # crbug.com/657665 for win and mac @decorators.Disabled('win', 'mac') -class HackerNewsStory(_NewsBrowsingStory): +class HackerNewsStory(_ArticleBrowsingStory): NAME = 'browse:news:hackernews' URL = 'https://news.ycombinator.com' ITEM_SELECTOR = '.athing .title > a' -class NytimesMobileStory(_NewsBrowsingStory): +class NytimesMobileStory(_ArticleBrowsingStory): """The third top website in http://www.alexa.com/topsites/category/News""" NAME = 'browse:news:nytimes' URL = 'http://mobile.nytimes.com' @@ -158,7 +175,7 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY -class NytimesDesktopStory(_NewsBrowsingStory): +class NytimesDesktopStory(_ArticleBrowsingStory): """The third top website in http://www.alexa.com/topsites/category/News""" NAME = 'browse:news:nytimes' URL = 'http://www.nytimes.com' @@ -168,7 +185,7 @@ # Desktop qq.com opens a news item in a separate tab, for which the back button # does not work. -class QqMobileStory(_NewsBrowsingStory): +class QqMobileStory(_ArticleBrowsingStory): NAME = 'browse:news:qq' URL = 'http://news.qq.com' ITEM_SELECTOR = '.list .full a' @@ -176,7 +193,7 @@ TAGS = [story_tags.INTERNATIONAL] -class RedditDesktopStory(_NewsBrowsingStory): +class RedditDesktopStory(_ArticleBrowsingStory): """The top website in http://www.alexa.com/topsites/category/News""" NAME = 'browse:news:reddit' URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' @@ -184,7 +201,7 @@ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY -class RedditMobileStory(_NewsBrowsingStory): +class RedditMobileStory(_ArticleBrowsingStory): """The top website in http://www.alexa.com/topsites/category/News""" NAME = 'browse:news:reddit' URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' @@ -193,7 +210,7 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY -class TwitterMobileStory(_NewsBrowsingStory): +class TwitterMobileStory(_ArticleBrowsingStory): NAME = 'browse:social:twitter' URL = 'https://www.twitter.com/nasa' ITEM_SELECTOR = '.Tweet-text' @@ -202,7 +219,7 @@ @decorators.Disabled('win') # crbug.com/662971 -class TwitterDesktopStory(_NewsBrowsingStory): +class TwitterDesktopStory(_ArticleBrowsingStory): NAME = 'browse:social:twitter' URL = 'https://www.twitter.com/nasa' IS_SINGLE_PAGE_APP = True @@ -210,7 +227,7 @@ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY -class WashingtonPostMobileStory(_NewsBrowsingStory): +class WashingtonPostMobileStory(_ArticleBrowsingStory): """Progressive website""" NAME = 'browse:news:washingtonpost' URL = 'https://www.washingtonpost.com/pwa' @@ -238,7 +255,7 @@ @decorators.Disabled('win') # crbug.com/673775 -class GoogleDesktopStory(_NewsBrowsingStory): +class GoogleDesktopStory(_ArticleBrowsingStory): """ A typical google search story: _ Start at https://www.google.com/search?q=flower @@ -289,7 +306,7 @@ action_runner.ScrollPage() -class GoogleIndiaDesktopStory(_NewsBrowsingStory): +class GoogleIndiaDesktopStory(_ArticleBrowsingStory): """ A typical google search story in India: 1. Start at https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2` @@ -376,6 +393,7 @@ ITEM_SELECTOR = '.Navbar-customAction' SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY IS_SINGLE_PAGE_APP = True + TAGS = [story_tags.EMERGING_MARKET] # crbug.com/704197 for win and mac @@ -396,6 +414,7 @@ IS_SINGLE_PAGE_APP = True ITEM_SELECTOR_INDEX = 3 TAGS = [story_tags.JAVASCRIPT_HEAVY] + TAGS = [story_tags.EMERGING_MARKET] class YouTubeDesktopStory(_MediaBrowsingStory): @@ -420,6 +439,7 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY IS_SINGLE_PAGE_APP = True ITEM_SELECTOR_INDEX = 0 + TAGS = [story_tags.EMERGING_MARKET] class FacebookPhotosDesktopStory(_MediaBrowsingStory): @@ -483,3 +503,144 @@ '".Button.borderless.close.visible")') action_runner.ClickElement(element_function=x_element_function) action_runner.Wait(1) # Wait to make navigation realistic. + + +############################################################################## +# Emerging market browsing stories. +############################################################################## + + +@decorators.Disabled('android') # crbug.com/708300. +class BrowseFlipKartMobileStory(_ArticleBrowsingStory): + NAME = 'browse:shopping:flipkart' + URL = 'https://flipkart.com/search?q=Sunglasses' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEM_SELECTOR = '[style=\\"background-image: none;\\"]' + BACK_SELECTOR = '._3NH1qf' + ITEMS_TO_VISIT = 4 + IS_SINGLE_PAGE_APP = True + + def _WaitForNavigation(self, action_runner): + action_runner.WaitForElement(text='Details') + + def _NavigateBack(self, action_runner): + action_runner.ClickElement(selector=self.BACK_SELECTOR) + action_runner.WaitForElement(text="Sunglasses") + + +class BrowseAmazonMobileStory(_ArticleBrowsingStory): + NAME = 'browse:shopping:amazon' + URL = 'https://www.amazon.co.in/s/?field-keywords=Mobile' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEM_SELECTOR = '.aw-search-results' + ITEMS_TO_VISIT = 4 + + +class BrowseLazadaMobileStory(_ArticleBrowsingStory): + NAME = 'browse:shopping:lazada' + URL = 'https://www.lazada.co.id/catalog/?q=Wrist+watch' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEM_SELECTOR = '.merchandise__link' + ITEMS_TO_VISIT = 1 + + +class BrowseAvitoMobileStory(_ArticleBrowsingStory): + NAME = 'browse:shopping:avito' + URL = 'https://www.avito.ru/rossiya' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEM_SELECTOR = '.item-link' + ITEMS_TO_VISIT = 4 + + +class BrowseTOIMobileStory(_ArticleBrowsingStory): + NAME = 'browse:news:toi' + URL = 'http://m.timesofindia.com' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEMS_TO_VISIT = 4 + ITEM_SELECTOR = '.dummy-img' + + +class BrowseGloboMobileStory(_ArticleBrowsingStory): + NAME = 'browse:news:globo' + URL = 'http://www.globo.com' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEMS_TO_VISIT = 4 + ITEM_SELECTOR = '.hui-premium__title' + + +class BrowseCricBuzzMobileStory(_ArticleBrowsingStory): + NAME = 'browse:news:cricbuzz' + URL = 'http://m.cricbuzz.com' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + ITEMS_TO_VISIT = 3 + ITEM_SELECTOR = '.list-content' + + + +############################################################################## +# Maps browsing stories. +############################################################################## + + +class GoogleMapsMobileStory(system_health_story.SystemHealthStory): + """Story that browses google maps mobile page + + This story searches for nearby restaurants on google maps website and finds + directions to a chosen restaurant from search results. + """ + NAME = 'browse:tools:maps' + URL = 'https://maps.google.com/' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + _MAPS_SEARCH_BOX_SELECTOR = '.ml-searchbox-placeholder' + _RESTAURANTS_LOADED = '.ml-panes-categorical-list-results' + _SEARCH_NEW_AREA_SELECTOR = '.ml-reissue-search-button-inner' + _RESTAURANTS_LINK = '.ml-entity-list-item-info' + _DIRECTIONS_LINK = '[class="ml-button ml-inner-button-directions-fab"]' + _DIRECTIONS_LOADED = ('[class="ml-fab-inner ' + 'ml-button ml-button-navigation-fab"]') + _MAP_LAYER = '.ml-map' + + def _DidLoadDocument(self, action_runner): + # Submit search query. + self._ClickLink(self._MAPS_SEARCH_BOX_SELECTOR, action_runner) + action_runner.EnterText('restaurants near me') + action_runner.PressKey('Return') + action_runner.WaitForElement(selector=self._RESTAURANTS_LOADED) + action_runner.WaitForNetworkQuiescence() + action_runner.Wait(4) # User looking at restaurants + + # Open the restaurant list and select the first. + self._ClickLink(self._RESTAURANTS_LOADED, action_runner) + action_runner.WaitForElement(selector=self._RESTAURANTS_LINK) + action_runner.Wait(3) # User reads about restaurant + self._ClickLink(self._RESTAURANTS_LINK, action_runner) + action_runner.Wait(1) # Reading description + + # Open directions to the restaurant from Google. + self._ClickLink(self._DIRECTIONS_LINK, action_runner) + action_runner.Wait(0.5) + action_runner.EnterText('Google Mountain View') + action_runner.PressKey('Return') + action_runner.WaitForElement(selector=self._DIRECTIONS_LOADED) + action_runner.WaitForNetworkQuiescence() + action_runner.Wait(2) # Seeing direction + + def _ClickLink(self, selector, action_runner): + action_runner.WaitForElement(selector=selector) + action_runner.ClickElement(selector=selector)
diff --git a/tools/perf/page_sets/system_health/loading_stories.py b/tools/perf/page_sets/system_health/loading_stories.py index f3ab950..946e67d 100644 --- a/tools/perf/page_sets/system_health/loading_stories.py +++ b/tools/perf/page_sets/system_health/loading_stories.py
@@ -39,9 +39,10 @@ URL = 'https://search.yahoo.com/search;_ylt=?p=google' -class LoadAmazonStory(_LoadingStory): +class LoadAmazonDesktopStory(_LoadingStory): NAME = 'load:search:amazon' URL = 'https://www.amazon.com/s/?field-keywords=nexus' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY class LoadTaobaoDesktopStory(_LoadingStory): @@ -98,9 +99,10 @@ TAGS = [story_tags.INTERNATIONAL] -class LoadInstagramStory(_LoadingStory): +class LoadInstagramDesktopStory(_LoadingStory): NAME = 'load:social:instagram' URL = 'https://www.instagram.com/selenagomez/' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY class LoadPinterestStory(_LoadingStory): @@ -208,6 +210,14 @@ class LoadWikipediaStory(_LoadingStory): NAME = 'load:news:wikipedia' URL = 'https://en.wikipedia.org/wiki/Science' + TAGS = [story_tags.EMERGING_MARKET] + + +class LoadIrctcStory(_LoadingStory): + NAME = 'load:news:irctc' + URL = 'https://www.irctc.co.in' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] ################################################################################ @@ -220,6 +230,7 @@ NAME = 'load:media:youtube' URL = 'https://www.youtube.com/watch?v=QGfhS1hfTWw&autoplay=false' PLATFORM_SPECIFIC = True + TAGS = [story_tags.EMERGING_MARKET] class LoadDailymotionStory(_LoadingStory): @@ -269,6 +280,7 @@ URL = ( 'https://m.facebook.com/rihanna/photos/a.207477806675.138795.10092511675/10153911739606676/?type=3&source=54&ref=page_internal') SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] class LoadFacebookPhotosDesktopStory(_LoadingStory): @@ -331,11 +343,6 @@ action_runner.WaitForJavaScriptCondition( 'document.getElementById("apploadingdiv").style.height === "0px"') -class LoadMapsStory(_LoadingStory): - NAME = 'load:tools:maps' - URL = 'https://www.google.com/maps/place/London,+UK/' - - class LoadStackOverflowStory(_LoadingStory): NAME = 'load:tools:stackoverflow' URL = (
diff --git a/tools/perf/page_sets/system_health/searching_stories.py b/tools/perf/page_sets/system_health/searching_stories.py index 329a0cb..a4cc8d3 100644 --- a/tools/perf/page_sets/system_health/searching_stories.py +++ b/tools/perf/page_sets/system_health/searching_stories.py
@@ -2,12 +2,18 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from page_sets.system_health import platforms +from page_sets.system_health import story_tags from page_sets.system_health import system_health_story +from devil.android.sdk import keyevent # pylint: disable=import-error + +# TODO(ssid): Rename the search stories to browse stories crbug.com/708300. class SearchGoogleStory(system_health_story.SystemHealthStory): NAME = 'search:portal:google' URL = 'https://www.google.co.uk/' + TAGS = [story_tags.EMERGING_MARKET] _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' _RESULT_SELECTOR = '.r > a[href*="wikipedia"]' @@ -33,3 +39,66 @@ action_runner.Wait(1) action_runner.TapElement(selector=self._RESULT_SELECTOR) action_runner.tab.WaitForDocumentReadyStateToBeComplete() + + +class SearchOmniboxStory(system_health_story.SystemHealthStory): + """Story that peforms search by using omnibox search provider + + Loads a website and enters a search query on omnibox and navigates to default + search provider (google). + """ + NAME = 'browse:chrome:omnibox' + URL = 'https://www.google.co.in' + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + def _DidLoadDocument(self, action_runner): + app_ui = action_runner.tab.browser.GetAppUi() + platform = action_runner.tab.browser.platform + app_ui.WaitForUiNode(resource_id='url_bar') + url_bar = app_ui.GetUiNode(resource_id='url_bar') + url_bar.Tap() + action_runner.Wait(1) # user wait before typing + platform.android_action_runner.InputText('drake') + action_runner.Wait(0.5) # user wait after typing + platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) + + action_runner.WaitForNavigate() + action_runner.ScrollPage(use_touch=True, distance=500) + + +class MobileNewTabPageStory(system_health_story.SystemHealthStory): + """Story that loads new tab page and performs searches. + + For each of the search queries in |_SEARCH_TEXTS| below, this story does: + - enter the search query on the new tab page search box + - read results + - navigates back to new tab page + """ + + NAME = 'browse:chrome:newtab' + URL = 'chrome://newtab' + _SEARCH_TEXTS = ['does google know everything', + 'most famous paintings', + 'current weather', + 'best movies 2016', + 'how to tie a tie'] + + SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY + TAGS = [story_tags.EMERGING_MARKET] + + def _DidLoadDocument(self, action_runner): + app_ui = action_runner.tab.browser.GetAppUi() + platform = action_runner.tab.browser.platform + for keyword in self._SEARCH_TEXTS: + app_ui.WaitForUiNode(resource_id='search_box').Tap() + platform.android_action_runner.InputText(keyword) + platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) + action_runner.WaitForNavigate() + action_runner.Wait(1.5) # Read results + action_runner.ScrollPage(use_touch=True) + action_runner.NavigateBack() + action_runner.WaitForNavigate() + + app_ui.WaitForUiNode(resource_id='menu_button').Tap() + app_ui.WaitForUiNode(resource_id='menu_item_text')
diff --git a/tools/perf/page_sets/system_health/story_tags.py b/tools/perf/page_sets/system_health/story_tags.py index 71d5c51..4458165 100644 --- a/tools/perf/page_sets/system_health/story_tags.py +++ b/tools/perf/page_sets/system_health/story_tags.py
@@ -25,6 +25,9 @@ INTERNATIONAL = Tag( 'international', 'Story has navigations to websites with content in non ' 'English languages.') +EMERGING_MARKET = Tag( + 'emerging_market', 'Story has significant usage in emerging markets with ' + 'low-end mobile devices and slow network connections.') JAVASCRIPT_HEAVY = Tag( 'javascript_heavy', 'Story has navigations to websites with heavy usages ' 'of JavaScript. The story uses 20Mb+ memory for javascript and local '
diff --git a/tools/perf/run_benchmark b/tools/perf/run_benchmark index 228405ff..00fb6af 100755 --- a/tools/perf/run_benchmark +++ b/tools/perf/run_benchmark
@@ -15,8 +15,11 @@ def main(): - config = chromium_config.ChromiumConfig() + config = chromium_config.ChromiumConfig( + benchmark_dirs=[path_util.GetPerfBenchmarksDir()], + top_level_dir=path_util.GetPerfDir()) return benchmark_runner.main(config, [trybot_command.Trybot]) + if __name__ == '__main__': sys.exit(main())
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js index c3bfa31..cff4f54 100644 --- a/ui/login/account_picker/user_pod_row.js +++ b/ui/login/account_picker/user_pod_row.js
@@ -89,9 +89,8 @@ * @const */ var UserPodTabOrder = { - POD_INPUT: 1, // Password input field, Action box menu button, submit - // button next to password input field and the pod - // itself. + POD_INPUT: 1, // Password input field, Action box menu button and + // the pod itself. PIN_KEYBOARD: 2, // Pin keyboard below the password input field. POD_CUSTOM_ICON: 3, // Pod custom icon next to password input field. HEADER_BAR: 4, // Buttons on the header bar (Shutdown, Add User). @@ -819,7 +818,6 @@ if (this.submitButton) { this.submitButton.addEventListener('click', this.handleSubmitButtonClick_.bind(this)); - this.submitButton.tabIndex = UserPodTabOrder.POD_INPUT; } this.imageElement.addEventListener('load',
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index bf3df7e..1a3ae27 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc
@@ -257,7 +257,8 @@ const int title_height = std::max(icon_height, label_height) + title_padding; const int close_height = GetWidget()->widget_delegate()->ShouldShowCloseButton() - ? close_->height() + ? close_->height() + LayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CLOSE_BUTTON_MARGIN) : 0; insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0); return insets;
diff --git a/ui/views/bubble/bubble_frame_view_unittest.cc b/ui/views/bubble/bubble_frame_view_unittest.cc index bf955dd..3474899 100644 --- a/ui/views/bubble/bubble_frame_view_unittest.cc +++ b/ui/views/bubble/bubble_frame_view_unittest.cc
@@ -145,12 +145,12 @@ EXPECT_EQ(kArrow, frame.bubble_border()->arrow()); EXPECT_EQ(kColor, frame.bubble_border()->background_color()); - int margin_x = frame.content_margins().left(); - int margin_y = frame.content_margins().top() + - frame.GetCloseButtonForTest()->height(); - gfx::Insets insets = frame.bubble_border()->GetInsets(); - EXPECT_EQ(insets.left() + margin_x, frame.GetBoundsForClientView().x()); - EXPECT_EQ(insets.top() + margin_y, frame.GetBoundsForClientView().y()); + gfx::Insets frame_insets = frame.GetInsets(); + gfx::Insets border_insets = frame.bubble_border()->GetInsets(); + EXPECT_EQ(border_insets.left() + frame_insets.left(), + frame.GetBoundsForClientView().x()); + EXPECT_EQ(border_insets.top() + frame_insets.top(), + frame.GetBoundsForClientView().y()); } // Tests that the arrow is mirrored as needed to better fit the screen.
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc index bd8e65f1..4951349f 100644 --- a/ui/views/controls/link.cc +++ b/ui/views/controls/link.cc
@@ -167,6 +167,7 @@ } void Link::OnNativeThemeChanged(const ui::NativeTheme* theme) { + Label::OnNativeThemeChanged(theme); Label::SetEnabledColor(GetEnabledColor()); SetDisabledColor( theme->GetSystemColor(ui::NativeTheme::kColorId_LinkDisabled));
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc index d11cfddd..ff365d4f 100644 --- a/ui/views/window/dialog_delegate_unittest.cc +++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -28,15 +28,7 @@ class TestDialog : public DialogDelegateView { public: - TestDialog() - : input_(new views::Textfield()), - canceled_(false), - accepted_(false), - closed_(false), - closeable_(false), - should_handle_escape_(false) { - AddChildView(input_); - } + TestDialog() : input_(new views::Textfield()) { AddChildView(input_); } ~TestDialog() override {} void Init() { @@ -51,6 +43,7 @@ bool ShouldShowWindowTitle() const override { return !title_.empty(); } + bool ShouldShowCloseButton() const override { return show_close_button_; } // DialogDelegateView overrides: bool Cancel() override { @@ -66,7 +59,6 @@ return closeable_; } - // DialogDelegateView overrides: gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); } bool AcceleratorPressed(const ui::Accelerator& accelerator) override { return should_handle_escape_; @@ -92,6 +84,9 @@ } void set_title(const base::string16& title) { title_ = title; } + void set_show_close_button(bool show_close) { + show_close_button_ = show_close; + } void set_should_handle_escape(bool should_handle_escape) { should_handle_escape_ = should_handle_escape; } @@ -100,13 +95,14 @@ private: views::Textfield* input_; - bool canceled_; - bool accepted_; - bool closed_; + bool canceled_ = false; + bool accepted_ = false; + bool closed_ = false; // Prevent the dialog from closing, for repeated ok and cancel button clicks. - bool closeable_; + bool closeable_ = false; base::string16 title_; - bool should_handle_escape_; + bool show_close_button_ = true; + bool should_handle_escape_ = false; DISALLOW_COPY_AND_ASSIGN(TestDialog); }; @@ -118,9 +114,8 @@ void SetUp() override { ViewsTestBase::SetUp(); - dialog_ = new TestDialog(); - dialog_->Init(); - DialogDelegate::CreateDialogWidget(dialog_, GetContext(), nullptr)->Show(); + InitializeDialog(); + ShowDialog(); } void TearDown() override { @@ -128,6 +123,18 @@ ViewsTestBase::TearDown(); } + void InitializeDialog() { + if (dialog_) + dialog_->TearDown(); + + dialog_ = new TestDialog(); + dialog_->Init(); + } + + void ShowDialog() { + DialogDelegate::CreateDialogWidget(dialog_, GetContext(), nullptr)->Show(); + } + void SimulateKeyEvent(const ui::KeyEvent& event) { ui::KeyEvent event_copy = event; if (dialog()->GetFocusManager()->OnKeyEvent(event_copy)) @@ -208,12 +215,38 @@ const int point; const int hit; } cases[] = { - { border, HTSYSMENU }, - { border + 10, HTSYSMENU }, - { border + 20, HTCLIENT }, - { border + 50, HTCLIENT }, - { border + 60, HTCLIENT }, - { 1000, HTNOWHERE }, + {border, HTSYSMENU}, + {border + 10, HTSYSMENU}, + {border + 20, HTNOWHERE}, + {border + 50, HTCLIENT /* Space is reserved for the close button. */}, + {border + 60, HTCLIENT}, + {1000, HTNOWHERE}, + }; + + for (size_t i = 0; i < arraysize(cases); ++i) { + gfx::Point point(cases[i].point, cases[i].point); + EXPECT_EQ(cases[i].hit, frame->NonClientHitTest(point)) + << " case " << i << " with border: " << border << ", at point " + << cases[i].point; + } +} + +TEST_F(DialogTest, HitTest_HiddenTitleNoCloseButton) { + InitializeDialog(); + dialog()->set_show_close_button(false); + ShowDialog(); + + const NonClientView* view = dialog()->GetWidget()->non_client_view(); + BubbleFrameView* frame = static_cast<BubbleFrameView*>(view->frame_view()); + const int border = frame->bubble_border()->GetBorderThickness(); + + struct { + const int point; + const int hit; + } cases[] = { + {border, HTSYSMENU}, {border + 10, HTSYSMENU}, + {border + 20, HTCLIENT}, {border + 50, HTCLIENT}, + {border + 60, HTCLIENT}, {1000, HTNOWHERE}, }; for (size_t i = 0; i < arraysize(cases); ++i) {