Граф коммитов

261 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 5a78a77b68 Bug 1375825 - part2: ContentEventHandler::ExpandToClusterBoundary() should check the return value of nsTextFrame::PeekOffsetCharacter() r=jfkthame
ContentEventHandler::ExpandToClusterBoundary() doesn't check the return value of nsTextFrame::PeekOffsetCharacter().  Therefore, it may set its result to reversed offset. (e.g., when aForward is true and offset is 6, the result may be 5.  When aForward is false and offset is 5, the result may be 6.)

For avoiding that, ContentEventHandler::ExpandToClusterBoundary() should check the result and only when it returns nsIFrame::FOUND, it should compute the proper offset.

On the other hand, it's too bad for ContentEventHandler that nsTextFrame::PeekOffsetCharacter() to return nsIFrame::CONTINUE_UNSELECTABLE when the user-select style is "all" because IME doesn't expect such cases.

Therefore, this patch adds additional argument to nsIFrame::PeekOffsetCharacter(), aOptions which is a struct containing bool members.  The reason why it's not a bit mask enum is, such struct doesn't cause simple mistake at checking the value and the code is shorter.  When mIgnoreUserStyleAll of it is true, this patch makes nsTextFrame not return nsIFrame::CONTINUE_UNSELECTABLE.

MozReview-Commit-ID: ACNNBTP92YZ

--HG--
extra : rebase_source : bd85da902e7fb59135d15514cb20a5599a4a640b
2017-06-29 10:58:16 +09:00
Alexis Beingessner adb013669b Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst f3bf820bfd Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c75211cb95 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Mats Palmgren a254b64145 Bug 1364805 part 4 - Remove the now unused LayoutFrameType values from the ctors. r=jfkthame
MozReview-Commit-ID: 1RSDoc3pQXf
2017-05-26 12:11:11 +02:00
Mats Palmgren 1242172259 Bug 1364805 part 2 - Add a nsIFrame::mClass field and propagate the concrete class' value up the ctor chain. r=jfkthame
nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values.  For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.

MozReview-Commit-ID: 1N0AkCGo1ol
2017-05-26 12:11:11 +02:00
Mats Palmgren ec6b1ef065 Bug 1364805 part 1 - Make every concrete frame class be a NS_DECL_QUERYFRAME_TARGET. r=jfkthame
MozReview-Commit-ID: Gy9gcEYupeY
2017-05-26 12:11:11 +02:00
Timothy Guan-tin Chien 1d08bd439b Bug 1360500 - Allow custom colors on find selection type selections. r=jaws,masayuki,smaug
This patch implements chrome-only Selection#setColors and
Selection#resetColors methods, and use it to set the background color of
the preferences search highlight.

MozReview-Commit-ID: 2U92aBCAyeh

--HG--
extra : rebase_source : b07af1f37309d8184584b298a720cd5c1382929a
2017-05-10 10:48:50 -04:00
Emilio Cobos Álvarez 23bce99ae1 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk

--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Jeremy Chen 9a60f77d80 Bug 1343516 - clean up the mess of PropertyProvider and its implementations. r=jfkthame
The cleanup work includes:

part 1: make all methods 'const' for the abstract class of PropertyProvider.

part 2: make nsFontMetrics's StubPropertyProvider final.

part 3: make nsTextFrame's PropertyProvider final.

  Make some methods 'const' and some variables 'mutable', so we could let all the
  overridden methods stay const.

  We also need to make the pass-in parameter of gfxFontGroup's GetHyphenWidth const.
  Note that the comment of GetHyphenWidth seem outdated, so I fixed it as well.

part 4: make the member variables in nsTextFrame's PropertyProvider to be 'const'.

  Make all the member variables 'const' except mStart, mLength,
  mJustificationArrayStart, and mJustificationSpacings.

  The static function AdvanceToNextTab is fixed since we only use 2 of the 4 parameters.

part 5: coding style fix for nsTextFrame's PropertyProvider.

MozReview-Commit-ID: 1kbWPwx27aQ
2017-03-17 18:53:15 +08:00
Mats Palmgren ce00d19feb Bug 1343552 part 1 - Invalidate the cached flow length when the next-in-flow/continuation changes. r=jfkthame
MozReview-Commit-ID: Bz5YA60NY8I
2017-03-09 13:18:26 +01:00
Emilio Cobos Álvarez 1c87f99407 Bug 1334075: Part 2, mark some methods in nsTextFrame as final to avoid virtual calls. r=xidorn
MozReview-Commit-ID: FBhjFSNviBL
2017-01-26 15:43:12 +01:00
Emilio Cobos Álvarez ad0b4ef8b2 Bug 1334075: Part 1, Reformat nsTextFrame.h to match coding style. r=xidorn
MozReview-Commit-ID: FLgExDFFPXW
2017-01-26 15:43:06 +01:00
Ting-Yu Lin f1d19f16fb Bug 1332105 Part 1 - Convert SelectionDetails and related functions to use UniquePtr. r=dholbert
For the non-owning pointer usage like iterating SelectionDetails's linked
list, it's sufficient to use SelectionDetails*.

MozReview-Commit-ID: 7PCFhD6Iz8j

--HG--
extra : rebase_source : 2d26edd513a402384e26719b3c0b5362d7a4ebb8
2017-01-20 17:39:57 +08:00
Julian Seward 2a625e574c Bug 1316556 - Remove zeroing allocation in class nsIPresShell. r=dbaron.
--HG--
extra : rebase_source : 203c4848cf0fe321b429c78ddf71acd662755e6d
2016-12-01 09:06:50 +01:00
Jeremy Chen 23d3ede6fc Bug 1307402 - use a more precise bounding box for initial letter texts. r=jfkthame
MozReview-Commit-ID: 5OIXp0uQisn

--HG--
extra : rebase_source : 00f6a72742c763bb3ec572a08d3cdaf12402d7f6
2016-10-04 22:22:52 +08:00
Jonathan Kew 95a82f84cc Bug 1280887 - patch 2 - Make gfxTextRun refcounted, replace usage of UniquePtr<> with RefPtr<> for textruns, and make nsTextFrame hold a strong reference to its run(s). r=mats 2016-08-19 13:14:22 +01:00
Jonathan Watt db80f397f6 Bug 1058040, part 2 - Rename gfxTextContextPaint to SVGContextPaint and add some code comments. r=dholbert 2016-07-22 14:56:09 +01:00
Ting-Yu Lin 40fcd21b9a Bug 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron
This patch is generated by the following script:

function rename() {
find .\
     -type f\
     ! -path "./obj*"\
     ! -path "./.git"\
     ! -path "./.hg"\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "([[:alpha:]]*)([rR])eflowState(s?)" "\1\2eflowInput\3"

MozReview-Commit-ID: ITFO7uMTkSb

--HG--
extra : rebase_source : c91a2e174a0baec60c1b0111ac7636295004ab35
2016-07-21 18:36:39 +08:00
Ting-Yu Lin 4053c4c028 Bug 1277129 Part 5c - Rename nsHTMLReflowMetrics to ReflowOutput. r=dbaron
This patch is generated by the following script:

function rename() {
find .\
     -type f\
     ! -path "./obj*"\
     ! -path "./.git"\
     ! -path "./.hg"\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -e "s/$1/$2/g" "{}" \;
}

rename "nsHTMLReflowMetrics" "ReflowOutput"

MozReview-Commit-ID: 2HBb7DkooH5

--HG--
extra : rebase_source : acfa442a6483772fcb5748dc6f5e7072e599032a
2016-07-21 18:36:38 +08:00
Ting-Yu Lin 820f88de49 Bug 1277129 Part 1c - Rename nsHTMLReflowState to ReflowInput. r=dbaron
This patch is generated by the following script:

function rename() {
find .\
     -type f\
     ! -path "./obj*"\
     ! -path "./.git"\
     ! -path "./.hg"\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -e "s/$1/$2/g" "{}" \;
}

rename nsHTMLReflowState ReflowInput

MozReview-Commit-ID: 9r9vdVv1pXc

--HG--
extra : rebase_source : 623ec822996ba0ea0058dd137acf5a658cdea04a
2016-07-21 18:36:35 +08:00
cku 77db71816d Bug 1287705 - Part 2. Add more comments and construct PaintState in PaintTextParams. r=jfkthame
MozReview-Commit-ID: EzfOzRUU6PQ

--HG--
extra : rebase_source : 1a7b96239b0d90f4e58be358629a7e3987b674ba
2016-07-19 20:48:19 +08:00
Makoto Kato fb90c3584f Bug 1203871 - Part 1. Add nsIFrame::GetCharacterRectsInRange. r=jfkthame
Masayuki suggests GetCharcterRectsInRange instead of first idea's API by part 2 implementation.

IME wants to need the width per character.  Now nsTextFrame/nsIFrmae has only API to get point of string.  So I want to add this method to calculate simply by comment #3.

If no text frame,  I would like to return error due to no character.  (Caller shouldn't call this API on non-text frame.)

MozReview-Commit-ID: LQHUTzhnGn

--HG--
extra : rebase_source : bc495493c7be73afb05489ad2169e8dcdd6e6da4
extra : histedit_source : e54a7c3bfb100765317a0c8a83b432d5f706ffe1
2016-06-23 12:02:14 +01:00
Masayuki Nakano 00591135a4 Bug 1278014 part.2 Define mozilla::SelectionType as an enum class and use it instead of RawSelectionType as far as possible r=smaug
This patch defines mozilla::SelectionType as an enum class.  This is safer than nsISelectionController::SELECTION_* since setting illegal value to its variable is checked at build time.  So, as far as possible, this should be used everywhere (but of course, this isn't available in scriptable interfaces).

And also this implements some useful methods for managing SelectionType and RawSelectionType which are implemented in layout/nsSelection.cpp because nsISelectionController is implemented by both PresShell and nsTextEditorState.  Therefore, implementing one of them may make hard to find them.  On the other hand, nsSelection.cpp is a better file name to look for them.

Note that this patch creates mozilla::Selection::RawType() for binding.  Native code should keep using Selection::Type() but the binding code needs to use RawType() due to impossible to convert from SelectionType to RawSelectionType without explicit cast.

MozReview-Commit-ID: 81vX7A0hHQN

--HG--
extra : rebase_source : d9f88e217c713c60d1c2578ce6421c73ccba8650
2016-06-11 11:06:37 +09:00
Masayuki Nakano 17f667a2e2 Bug 1278014 part.1 Rename SelectionType in nsISelectionController.idl to mozilla::RawSelectionType r=smaug
mozilla::SelectionType will be an enum class. Therefore, we need to rename SelectionType with a word "raw" since it's a type for raw nsISelectionController::SELECTION_*.

MozReview-Commit-ID: K8SO0bbpv0Y

--HG--
extra : rebase_source : 56e3ac852657ef4795d718d2da09b16903c2e66c
2016-06-07 22:42:06 +09:00
CJKu 3e44bcb79b Bug 1269971 - Part 7. Clean out unused things created in bug 759568; r=jfkthame
MozReview-Commit-ID: 4spLj1fgthI

--HG--
extra : rebase_source : 02261090faab2c37cf5e9c35b223832ec3af59cf
2016-05-13 00:09:39 +08:00
CJKu 31d52bc0c4 Bug 1269971 - Part 3. Handle selection text color and selection backgrond painting; r=jfkthame
MozReview-Commit-ID: CQmqiCmvygr

--HG--
extra : rebase_source : 271b8d2aae82c02678637bcbbb3a77bc7c5b43f8
2016-05-13 00:08:53 +08:00
CJKu b901424670 Bug 1269971 - Part 2. From ClipBackgroundByText to GenerateAndPushTextMask; r=jfkthame,mtseng
MozReview-Commit-ID: 1PK2Huytq3i

--HG--
extra : rebase_source : 71f3e70694d874d5d575b12f882980544b1931e2
2016-05-13 00:08:41 +08:00
Matt Woodrow 47cde44daf Bug 1243610 - Refactor UpdateOverflow to separate out local overflow from that contributed by descendants. r=dbaron 2016-05-04 12:27:43 +12:00
Jeremy Chen f7a19af3e7 Bug 1248708 - Part2.2: render -webkit-text-stroke property. r=jfkthame 2016-04-23 01:40:39 +08:00
Xidorn Quan f819b73b7b Bug 1097499 part 14 - Draw emphasis marks properly for text-combine-upright. r=jfkthame
MozReview-Commit-ID: 2bHWXxZDVGk

--HG--
extra : source : 492cd1cb7e3bc5e776042fddc2a656ec9160a2a9
2016-04-22 09:18:41 +10:00
Xidorn Quan e775e87790 Bug 1097499 part 13 - Draw decoration line properly for text-combine-upright. r=jfkthame
MozReview-Commit-ID: AymG09nvxh1

--HG--
extra : source : 579ca910016a1af95bb36b66d2ceb309d40288d3
2016-04-22 09:18:41 +10:00
Xidorn Quan d8f6beea61 Bug 1097499 part 9 - Transform full-width characters to non-full-width correspondents for combined text. r=jfkthame
MozReview-Commit-ID: CXntBz9HPJu

--HG--
extra : source : 950029490bd0f6d5900140693e8ab193a9efe543
2016-04-22 09:18:41 +10:00
Jonathan Kew 97936698fe Bug 1265648 - Remove the global nsTextFrameTextRunCache, as it no longer serves any useful purpose. r=mats 2016-04-20 10:54:43 +01:00
CJKu 45fda349c6 Bug 759568 - Part 3. Render text-selection beneath background image; r=jfkthame
MozReview-Commit-ID: 3VUGqyJOX8Q
2016-04-14 16:28:07 +08:00
CJKu 2afb6ec588 Bug 759568 - Part 2. Render background-clip:text; r=jfkthame
MozReview-Commit-ID: HQHBe7OioWs
2016-04-14 16:28:07 +08:00
Carsten "Tomcat" Book 48bbe10c12 Backed out changeset 6a2e62e8c861 (bug 759568) 2016-04-14 08:57:41 +02:00
Carsten "Tomcat" Book 9447faf13b Backed out changeset e9fc67d8b0fa (bug 759568) 2016-04-14 08:57:39 +02:00
CJKu 61564fb540 Bug 759568 - Part 3. Render text-selection beneath background image; r=jfkthame
MozReview-Commit-ID: 3VUGqyJOX8Q
2016-04-14 12:45:38 +08:00
CJKu 3edbcce808 Bug 759568 - Part 2. Render background-clip:text; r=jfkthame
MozReview-Commit-ID: HQHBe7OioWs
2016-04-14 12:45:38 +08:00
Sebastian Hengst c9828de0c3 Backed out changeset e64951d74d2a (bug 759568) 2016-04-12 17:55:44 +02:00
Sebastian Hengst 1942339f7b Backed out changeset 21551ed8f1e1 (bug 759568) 2016-04-12 17:55:36 +02:00
CJKu 7c3766dbb4 Bug 759568 - Part 3. Render text-selection beneath background image; r=jfkthame
MozReview-Commit-ID: 3VUGqyJOX8Q
2016-04-12 21:58:22 +08:00
CJKu 70f4e828d2 Bug 759568 - Part 2. Render background-clip:text; r=jfkthame
MozReview-Commit-ID: HQHBe7OioWs
2016-04-12 21:58:22 +08:00
Xidorn Quan d0fc466aa2 Bug 1258636 part 2 - Use struct to pass params for nsTextFrame::PaintDecorationLine. r=jfkthame
MozReview-Commit-ID: CICgNSPRrLM

--HG--
extra : rebase_source : 2901710ea2806a98b3520dc729c4f4d4ba2d56b2
2016-03-22 17:42:18 +08:00
Ting-Yu Lin 02389a3aba Bug 1251519 Part 1 - Remove nsTextFrameBase as an nsFrame alias. r=mats
Bug 655877 Part 20 made this deliberately to let nsTextFrame
QueryFrame-able. https://hg.mozilla.org/mozilla-central/rev/d8c6025c0881

But other types like nsPlaceholderFrame or nsBulletFrame are also
implemented QureyFrame, which do not have this inheritance indirection.
I guess it was for historical reason, and can be removed safely.

MozReview-Commit-ID: CPeQvpKzEKh

--HG--
extra : rebase_source : 86e784648cab3982ff16b3d45a312b98cd963841
2016-03-10 17:38:31 +08:00
Xidorn Quan b022cd37f8 Bug 1251995 part 7 - Use struct to pass params for nsTextFrame::Paint*Shadow functions. r=jfkthame
MozReview-Commit-ID: 5Wa9U0Ile4L

--HG--
extra : source : 95464b236e0e5c52495445a94301791a25668094
2016-03-08 15:56:18 +08:00
Xidorn Quan 40f8859cc1 Bug 1251995 part 6 - Use struct to pass params for nsTextFrame::PaintText* functions. r=jfkthame
MozReview-Commit-ID: NTEUm8TY8N

--HG--
extra : source : d1f1d14ddf9df26f07a28a36e54216b8ad6ff5fb
2016-03-08 15:56:18 +08:00
Xidorn Quan e1002ffcb3 Bug 1251995 part 5 - Unify units of dirty rect used for painting text frame. r=jfkthame
MozReview-Commit-ID: BK7j6y7lBV3

--HG--
extra : source : 4403438493793ddfa7356cab2438d050f8a66da1
2016-03-08 15:56:18 +08:00