item;
@@ -2431,19 +2547,19 @@ nsFlexContainerFrame::GenerateFlexLines(
!curLine->IsEmpty() && // No need to wrap at start of a line.
wrapThreshold < (curLine->GetTotalOuterHypotheticalMainSize() +
itemOuterHypotheticalMainSize)) {
- curLine = AddNewFlexLineToList(aLines);
+ curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
}
// Add item to current flex line (and update the line's bookkeeping about
// how large its items collectively are).
- curLine->AddItem(item.forget(),
+ curLine->AddItem(item.forget(), shouldInsertAtFront,
itemInnerHypotheticalMainSize,
itemOuterHypotheticalMainSize);
// Honor "page-break-after", if we're multi-line and have more children:
if (!isSingleLine && childFrame->GetNextSibling() &&
childFrame->StyleDisplay()->mBreakAfter) {
- curLine = AddNewFlexLineToList(aLines);
+ curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
}
itemIdxInContainer++;
}
@@ -2636,6 +2752,23 @@ ResolveReflowedChildAscent(nsIFrame* aFrame,
}
}
+/**
+ * Given the flex container's "logical ascent" (i.e. distance from the
+ * flex container's content-box cross-start edge to its baseline), returns
+ * its actual physical ascent value (the distance from the *border-box* top
+ * edge to its baseline).
+ */
+static nscoord
+ComputePhysicalAscentFromLogicalAscent(nscoord aLogicalAscent,
+ nscoord aContentBoxCrossSize,
+ const nsHTMLReflowState& aReflowState,
+ const FlexboxAxisTracker& aAxisTracker)
+{
+ return aReflowState.ComputedPhysicalBorderPadding().top +
+ PhysicalPosFromLogicalPos(aLogicalAscent, aContentBoxCrossSize,
+ aAxisTracker.GetCrossAxis());
+}
+
nsresult
nsFlexContainerFrame::SizeItemInCrossAxis(
nsPresContext* aPresContext,
@@ -2741,7 +2874,7 @@ FlexLine::PositionItemsInCrossAxis(nscoord aLineStartPosition,
nscoord itemCrossBorderBoxSize =
item->GetCrossSize() +
item->GetBorderPaddingSizeInAxis(aAxisTracker.GetCrossAxis());
- lineCrossAxisPosnTracker.EnterAlignPackingSpace(*this, *item);
+ lineCrossAxisPosnTracker.EnterAlignPackingSpace(*this, *item, aAxisTracker);
lineCrossAxisPosnTracker.EnterMargin(item->GetMargin());
lineCrossAxisPosnTracker.EnterChildFrame(itemCrossBorderBoxSize);
@@ -2949,29 +3082,23 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
}
}
- // Set the flex container's baseline, from the baseline-alignment position
- // of the first line's baseline-aligned items.
+ // If the container should derive its baseline from the first FlexLine,
+ // do that here (while crossAxisPosnTracker is conveniently pointing
+ // at the cross-start edge of that line, which the line's baseline offset is
+ // measured from):
nscoord flexContainerAscent;
- nscoord firstLineBaselineOffset =
- lines.getFirst()->GetBaselineOffsetFromCrossStart();
- if (firstLineBaselineOffset == nscoord_MIN) {
- // No baseline-aligned flex items in first line --> just use a sentinel
- // value for now, and we'll update it during final reflow.
- flexContainerAscent = nscoord_MIN;
- } else {
- // Add the position of the first line to that line's baseline-alignment
- // offset, to get the baseline offset with respect to the *container's*
- // cross-start edge.
- nscoord firstLineBaselineOffsetWRTContainer =
- firstLineBaselineOffset + crossAxisPosnTracker.GetPosition();
-
- // The container's ascent is that ^ offset, converted out of logical coords
- // (into distance from top of content-box), plus the top border/padding
- // (since ascent is measured with respect to the top of the border-box).
- flexContainerAscent = aReflowState.ComputedPhysicalBorderPadding().top +
- PhysicalPosFromLogicalPos(firstLineBaselineOffsetWRTContainer,
- contentBoxCrossSize,
- aAxisTracker.GetCrossAxis());
+ if (!aAxisTracker.AreAxesInternallyReversed()) {
+ nscoord firstLineBaselineOffset = lines.getFirst()->GetBaselineOffset();
+ if (firstLineBaselineOffset == nscoord_MIN) {
+ // No baseline-aligned items in line. Use sentinel value to prompt us to
+ // get baseline from the first FlexItem after we've reflowed it.
+ flexContainerAscent = nscoord_MIN;
+ } else {
+ flexContainerAscent =
+ ComputePhysicalAscentFromLogicalAscent(
+ crossAxisPosnTracker.GetPosition() + firstLineBaselineOffset,
+ contentBoxCrossSize, aReflowState, aAxisTracker);
+ }
}
for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
@@ -2990,6 +3117,24 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
crossAxisPosnTracker.TraversePackingSpace();
}
+ // If the container should derive its baseline from the last FlexLine,
+ // do that here (while crossAxisPosnTracker is conveniently pointing
+ // at the cross-end edge of that line, which the line's baseline offset is
+ // measured from):
+ if (aAxisTracker.AreAxesInternallyReversed()) {
+ nscoord lastLineBaselineOffset = lines.getLast()->GetBaselineOffset();
+ if (lastLineBaselineOffset == nscoord_MIN) {
+ // No baseline-aligned items in line. Use sentinel value to prompt us to
+ // get baseline from the last FlexItem after we've reflowed it.
+ flexContainerAscent = nscoord_MIN;
+ } else {
+ flexContainerAscent =
+ ComputePhysicalAscentFromLogicalAscent(
+ crossAxisPosnTracker.GetPosition() - lastLineBaselineOffset,
+ contentBoxCrossSize, aReflowState, aAxisTracker);
+ }
+ }
+
// Before giving each child a final reflow, calculate the origin of the
// flex container's content box (with respect to its border-box), so that
// we can compute our flex item's final positions.
diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp
index d344871c9326..526041e63646 100644
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -286,6 +286,7 @@ ReparentChildListStyle(nsPresContext* aPresContext,
for (nsFrameList::Enumerator e(aFrames); !e.AtEnd(); e.Next()) {
NS_ASSERTION(e.get()->GetParent() == aParentFrame, "Bogus parentage");
restyleManager->ReparentStyleContext(e.get());
+ nsLayoutUtils::MarkDescendantsDirty(e.get());
}
}
@@ -424,6 +425,7 @@ nsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags,
f->SetParent(this);
if (inFirstLine) {
restyleManager->ReparentStyleContext(f);
+ nsLayoutUtils::MarkDescendantsDirty(f);
}
}
}
@@ -529,6 +531,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
child->SetParent(this);
if (inFirstLine) {
restyleManager->ReparentStyleContext(child);
+ nsLayoutUtils::MarkDescendantsDirty(child);
}
// We also need to do the same for |frame|'s next-in-flows that are in
// the sibling list. Otherwise, if we reflow |frame| and it's complete
@@ -563,6 +566,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
nextInFlow->SetParent(this);
if (inFirstLine) {
restyleManager->ReparentStyleContext(nextInFlow);
+ nsLayoutUtils::MarkDescendantsDirty(nextInFlow);
}
}
else {
@@ -1005,6 +1009,7 @@ nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowState& i
// style-context that we just pulled.
NS_ASSERTION(frame->GetParent() == this, "Incorrect parent?");
aPresContext->RestyleManager()->ReparentStyleContext(frame);
+ nsLayoutUtils::MarkDescendantsDirty(frame);
}
return frame;
}
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index db056162c54d..e4b85009af8f 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4441,7 +4441,6 @@ nsTextFrame::CharacterDataChanged(CharacterDataChangeInfo* aInfo)
nsTextFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
{
nsFrame::DidSetStyleContext(aOldStyleContext);
- ClearTextRuns();
}
class nsDisplayTextGeometry : public nsDisplayItemGenericGeometry
diff --git a/layout/reftests/first-letter/font-text-styles-floater-ref.html b/layout/reftests/first-letter/font-text-styles-floater-ref.html
new file mode 100644
index 000000000000..337aabeb992d
--- /dev/null
+++ b/layout/reftests/first-letter/font-text-styles-floater-ref.html
@@ -0,0 +1,28 @@
+
+
+
+Testing first-letter handling of font/text styles
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/first-letter/font-text-styles-floater.html b/layout/reftests/first-letter/font-text-styles-floater.html
new file mode 100644
index 000000000000..b68a5579c8da
--- /dev/null
+++ b/layout/reftests/first-letter/font-text-styles-floater.html
@@ -0,0 +1,27 @@
+
+
+
+Testing first-letter handling of font/text styles
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/first-letter/font-text-styles-ref.html b/layout/reftests/first-letter/font-text-styles-ref.html
new file mode 100644
index 000000000000..a9e400d1b632
--- /dev/null
+++ b/layout/reftests/first-letter/font-text-styles-ref.html
@@ -0,0 +1,33 @@
+
+
+
+Testing first-letter handling of font/text styles
+
+
+
+
+
+
+
+
Yellow corndog
+
hIPPIE BANANA
+
Gonzo macadamia
+
fELICITOUS Raspberry
+
+
+
diff --git a/layout/reftests/first-letter/font-text-styles.html b/layout/reftests/first-letter/font-text-styles.html
new file mode 100644
index 000000000000..e117a6bbf603
--- /dev/null
+++ b/layout/reftests/first-letter/font-text-styles.html
@@ -0,0 +1,35 @@
+
+
+
+Testing first-letter handling of font/text styles
+
+
+
+
+
+
+
+
yellow corndog
+
HIPPIE BANANA
+
gonzo macadamia
+
FELICITOUS raspberry
+
+
+
diff --git a/layout/reftests/first-letter/reftest.list b/layout/reftests/first-letter/reftest.list
index b510dfd736fe..020f020314a5 100644
--- a/layout/reftests/first-letter/reftest.list
+++ b/layout/reftests/first-letter/reftest.list
@@ -63,3 +63,5 @@ fails-if(winWidget||cocoaWidget) == 617869-1.html 617869-1-ref.html
== 723509-1.html 723509-1-ref.html
== 922550-1.html 922550-1-ref.html
== 958249.html 958249-ref.html
+== font-text-styles.html font-text-styles-ref.html
+fails-if(gtk2Widget) random-if(winWidget&&!d2d) == font-text-styles-floater.html font-text-styles-floater-ref.html # bug 992846
diff --git a/layout/reftests/first-line/font-styles-nooverflow.html b/layout/reftests/first-line/font-styles-nooverflow.html
new file mode 100644
index 000000000000..5cf63f1b5d35
--- /dev/null
+++ b/layout/reftests/first-line/font-styles-nooverflow.html
@@ -0,0 +1,29 @@
+
+
+
+Simple first-line test
+
+
+
+
+
+sans-serif
serif bold serif italic
just italicitalic too
+
diff --git a/layout/reftests/first-line/font-styles-ref.html b/layout/reftests/first-line/font-styles-ref.html
new file mode 100644
index 000000000000..d68b28a1d054
--- /dev/null
+++ b/layout/reftests/first-line/font-styles-ref.html
@@ -0,0 +1,29 @@
+
+
+
+Simple first-line test
+
+
+
+
+
+sans-serif
serif bold serif italic
just italicitalic too
+
\ No newline at end of file
diff --git a/layout/reftests/first-line/font-styles.html b/layout/reftests/first-line/font-styles.html
new file mode 100644
index 000000000000..a330f54e7222
--- /dev/null
+++ b/layout/reftests/first-line/font-styles.html
@@ -0,0 +1,29 @@
+
+
+
+Simple first-line test
+
+
+
+
+
+sans-serif
serif bold serif italic
just italicitalic too
+
\ No newline at end of file
diff --git a/layout/reftests/first-line/reftest.list b/layout/reftests/first-line/reftest.list
index bca4ee8dd108..9e0cca7081d6 100644
--- a/layout/reftests/first-line/reftest.list
+++ b/layout/reftests/first-line/reftest.list
@@ -33,3 +33,5 @@ load stress-10.html # crash test
== 469227-3.html 469227-3-ref.html
== restyle-inside-first-line.html restyle-inside-first-line-ref.html
+== font-styles.html font-styles-ref.html
+== font-styles-nooverflow.html font-styles-ref.html
diff --git a/layout/reftests/text-transform/capitalize-7a.html b/layout/reftests/text-transform/capitalize-7a.html
new file mode 100644
index 000000000000..06360354cfa1
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-7a.html
@@ -0,0 +1,11 @@
+
+
+
+
+blah blah
+
+
diff --git a/layout/reftests/text-transform/reftest.list b/layout/reftests/text-transform/reftest.list
index 8a55f5b19bb6..8205abc4ba07 100644
--- a/layout/reftests/text-transform/reftest.list
+++ b/layout/reftests/text-transform/reftest.list
@@ -5,6 +5,7 @@
== capitalize-5.html capitalize-5-ref.html
== capitalize-6.html capitalize-6-ref.html
== capitalize-7.html capitalize-7-ref.html
+== capitalize-7a.html capitalize-7-ref.html
== lowercase-1.html lowercase-ref.html
== lowercase-sigma-1.html lowercase-sigma-1-ref.html
== small-caps-1.html small-caps-1-ref.html
diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp
index 06c76093c0c3..a878b41ea1e5 100644
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -3312,7 +3312,7 @@ SVGTextFrame::ScheduleReflowSVGNonDisplayText()
MOZ_ASSERT(f, "should have found an ancestor frame to reflow");
PresContext()->PresShell()->FrameNeedsReflow(
- f, nsIPresShell::eResize, NS_FRAME_HAS_DIRTY_CHILDREN);
+ f, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
}
NS_IMPL_ISUPPORTS1(SVGTextFrame::MutationObserver, nsIMutationObserver)
diff --git a/netwerk/ipc/RemoteOpenFileChild.cpp b/netwerk/ipc/RemoteOpenFileChild.cpp
index 748406baa5a2..c15c9550a2f3 100644
--- a/netwerk/ipc/RemoteOpenFileChild.cpp
+++ b/netwerk/ipc/RemoteOpenFileChild.cpp
@@ -4,8 +4,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "mozilla/net/RemoteOpenFileChild.h"
+#include "RemoteOpenFileChild.h"
+#include "mozilla/unused.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/URIUtils.h"
@@ -13,6 +14,7 @@
#include "nsThreadUtils.h"
#include "nsJARProtocolHandler.h"
#include "nsIRemoteOpenFileListener.h"
+#include "nsProxyRelease.h"
// needed to alloc/free NSPR file descriptors
#include "private/pprio.h"
@@ -83,8 +85,40 @@ RemoteOpenFileChild::RemoteOpenFileChild(const RemoteOpenFileChild& other)
RemoteOpenFileChild::~RemoteOpenFileChild()
{
- if (mListener) {
- NotifyListener(NS_ERROR_UNEXPECTED);
+ if (NS_IsMainThread()) {
+ if (mListener) {
+ NotifyListener(NS_ERROR_UNEXPECTED);
+ }
+ } else {
+ nsCOMPtr mainThread = do_GetMainThread();
+ if (mainThread) {
+ MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_ProxyRelease(mainThread, mURI, true)));
+ MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_ProxyRelease(mainThread, mAppURI, true)));
+ MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_ProxyRelease(mainThread, mListener,
+ true)));
+
+ TabChild* tabChild;
+ mTabChild.forget(&tabChild);
+
+ if (tabChild) {
+ nsCOMPtr runnable =
+ NS_NewNonOwningRunnableMethod(tabChild, &TabChild::Release);
+ MOZ_ASSERT(runnable);
+
+ MOZ_ALWAYS_TRUE(NS_SUCCEEDED(mainThread->Dispatch(runnable,
+ NS_DISPATCH_NORMAL)));
+ }
+ } else {
+ using mozilla::unused;
+
+ NS_WARNING("RemoteOpenFileChild released after thread shutdown, leaking "
+ "its members!");
+
+ unused << mURI.forget();
+ unused << mAppURI.forget();
+ unused << mListener.forget();
+ unused << mTabChild.forget();
+ }
}
if (mNSPRFileDesc) {
diff --git a/testing/marionette/client/marionette/tests/unit/test_window_management.py b/testing/marionette/client/marionette/tests/unit/test_window_management.py
index 6ab6773297d4..9b529209d9aa 100644
--- a/testing/marionette/client/marionette/tests/unit/test_window_management.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_management.py
@@ -11,10 +11,10 @@ class TestSwitchWindow(MarionetteTestCase):
self.marionette.set_script_timeout(5000)
self.marionette.execute_async_script("""
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
- .getService(Components.interfaces.nsIWindowWatcher);
+ .getService(Components.interfaces.nsIWindowWatcher);
var win = ww.openWindow(null, "chrome://browser/content/browser.xul", "testWin", null, null);
-win.addEventListener("load", function() {
- win.removeEventListener("load", arguments.callee, true);
+win.addEventListener("load", function() {
+ win.removeEventListener("load", arguments.callee, true);
marionetteScriptFinished();
}, null);
""")
@@ -24,7 +24,7 @@ win.addEventListener("load", function() {
self.marionette.set_context("chrome")
self.marionette.execute_script("""
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
- .getService(Components.interfaces.nsIWindowWatcher);
+ .getService(Components.interfaces.nsIWindowWatcher);
var win = ww.getWindowByName("testWin", null);
if (win != null)
win.close();
@@ -39,7 +39,7 @@ if (win != null)
self.assertEqual(self.marionette.current_window_handle, orig_win)
now_available = self.marionette.window_handles
#assert we can find the new window
- self.assertEqual(len(now_available), len(orig_available) + 1)
+ self.assertEqual(len(now_available), len(orig_available) + 1)
#assert that our window is there
self.assertTrue(orig_win in now_available)
new_win = None
@@ -59,16 +59,16 @@ if (win != null)
test_html = self.marionette.absolute_url("test_windows.html")
self.marionette.navigate(test_html)
current = self.marionette.current_window_handle
-
+
self.marionette.find_element('link text',"Open new window").click()
window_handles = self.marionette.window_handles
window_handles.remove(current)
-
+
self.marionette.switch_to_window(window_handles[0])
self.assertEqual(self.marionette.title, "We Arrive Here")
-
+
handle = self.marionette.current_window_handle
-
+
self.assertEqual(self.marionette.current_window_handle, handle)
self.assertEqual(2, len(self.marionette.window_handles))
diff --git a/testing/marionette/client/marionette/tests/unit/unit-tests.ini b/testing/marionette/client/marionette/tests/unit/unit-tests.ini
index 19a33a1f8aba..a6a8b25c1061 100644
--- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini
@@ -28,6 +28,9 @@ b2g = false
[test_getattr.py]
[test_getattr_chrome.py]
b2g = false
+[test_elementsize.py]
+[test_position.py]
+[test_rendered_element.py]
[test_elementState.py]
[test_elementState_chrome.py]
b2g = false
@@ -35,6 +38,10 @@ b2g = false
[test_text_chrome.py]
disabled = "Bug 896046"
+[test_clearing.py]
+[test_typing.py]
+disabled = "Bug 123456"
+
[test_log.py]
[test_emulator.py]
browser = false
@@ -77,12 +84,15 @@ browser = false
[test_specialpowers.py]
[test_switch_frame.py]
[test_switch_frame_chrome.py]
-
-
[test_switch_remote_frame.py]
-[test_visibility.py]
+[test_pagesource.py]
+
+[test_visibility.py]
+[test_window_switching.py]
+disabled = "Bug 990298"
[test_window_management.py]
+disabled = "Bug 990299"
b2g = false
[test_appcache.py]
@@ -103,4 +113,6 @@ disabled = "Bug 925688"
browser = false
[test_errors.py]
-[include:oop/manifest.ini]
+[test_execute_isolate.py]
+
+[include:oop/manifest.ini]
\ No newline at end of file
diff --git a/testing/marionette/client/marionette/www/rectangles.html b/testing/marionette/client/marionette/www/rectangles.html
index 56c6191cdcb7..59871c6de6a8 100644
--- a/testing/marionette/client/marionette/www/rectangles.html
+++ b/testing/marionette/client/marionette/www/rectangles.html
@@ -18,8 +18,8 @@
}
#r2 {
background-color: red;
- left: 10.9px;
- top: 10.1px;
+ left: 11px;
+ top: 10px;
width: 48.666666667px;
height: 49.333333333px;
}
diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp
index d9eb50ac6dba..6c7d32ca3fac 100644
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -770,12 +770,15 @@ AsyncFaviconDataReady::OnComplete(nsIURI *aFaviconURI,
dataSurface->Unmap();
} else {
- size.width = GetSystemMetrics(SM_CXSMICON);
- size.height = GetSystemMetrics(SM_CYSMICON);
- if (!size.width || !size.height) {
- size.width = 16;
- size.height = 16;
- }
+ // By using the input image surface's size, we may end up encoding
+ // to a different size than a 16x16 (or bigger for higher DPI) ICO, but
+ // Windows will resize appropriately for us. If we want to encode ourselves
+ // one day because we like our resizing better, we'd have to manually
+ // resize the image here and use GetSystemMetrics w/ SM_CXSMICON and
+ // SM_CYSMICON. We don't support resizing images asynchronously at the
+ // moment anyway so getting the DPI aware icon size won't help.
+ size.width = surface->GetSize().width;
+ size.height = surface->GetSize().height;
dataSurface = surface->GetDataSurface();
}
@@ -823,11 +826,6 @@ NS_IMETHODIMP AsyncEncodeAndWriteIcon::Run()
{
NS_PRECONDITION(!NS_IsMainThread(), "Should not be called on the main thread.");
- // Get the recommended icon width and height, or if failure to obtain
- // these settings, fall back to 16x16 ICOs. These values can be different
- // if the user has a different DPI setting other than 100%.
- // Windows would scale the 16x16 icon themselves, but it's better
- // we let our ICO encoder do it.
nsCOMPtr iconStream;
nsRefPtr encoder =
do_CreateInstance("@mozilla.org/image/encoder;2?"