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

97 Коммитов

Автор SHA1 Сообщение Дата
Poren Chiang 0ab9bb5418 Bug 1336426 - Query selected text before calling word breaker. r=masayuki,m_kato
When triggering dictionary lookup in native macOS apps, the currently selected text is used if the cursor falls within the selection range. Since Bug 1275486 and Bug 425915 are yet to be implemented, this patch could at least give the user ability to manually mark their query first.

Differential Revision: https://phabricator.services.mozilla.com/D57096

--HG--
extra : moz-landing-system : lando
2020-03-10 21:24:13 +00:00
Simon Giesecke d94419173b Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/base. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63102

--HG--
extra : moz-landing-system : lando
2020-02-21 10:41:47 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Brendan Dahl ccb8b2f945 Bug 1558674 - Allow chrome privileged documents to enable/disable copy/paste. r=Ehsan,bgrins
For content HTML/XHTML copy/paste should always be enabled, but for chrome
docs we can support enabling/disabling copy/paste.

Also, restores tests to how they were before copy/paste was always enabled.

Differential Revision: https://phabricator.services.mozilla.com/D34805

--HG--
extra : moz-landing-system : lando
2019-06-18 20:40:19 +00:00
Ciure Andrei 2e6ac83efb Backed out changeset 7312aba8ec3b (bug 1558674) for causing browser_console_context_menu_entries.js to permafail CLOSED TREE 2019-06-15 08:48:18 +03:00
Brendan Dahl 7c478fba5b Bug 1558674 - Allow chrome privileged documents to enable/disable copy/paste. r=Ehsan,bgrins
For content HTML/XHTML copy/paste should always be enabled, but for chrome
docs we can support enabling/disabling copy/paste.

Also, restores tests to how they were before copy/paste was always enabled.

Differential Revision: https://phabricator.services.mozilla.com/D34805

--HG--
extra : moz-landing-system : lando
2019-06-15 00:27:36 +00:00
Narcis Beleuzu 72a734cf98 Backed out changeset aa7f507ac743 (bug 1558674) for dt failures on browser_console_context_menu_entries.js . CLOSED TREE 2019-06-14 05:57:52 +03:00
Brendan Dahl 04a85879bb Bug 1558674 - Allow chrome privileged documents to enable/disable copy/paste. r=Ehsan
For content HTML/XHTML copy/paste should always be enabled, but for chrome
docs we can support enabling/disabling copy/paste.

Also, restores tests to how they were before copy/paste was always enabled.

Differential Revision: https://phabricator.services.mozilla.com/D34805

--HG--
extra : moz-landing-system : lando
2019-06-14 00:32:21 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Boris Chiou d332d1218d Bug 1272409 - Fix fuzzy unified build failed after adding new files into dom/base. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28934

--HG--
extra : moz-landing-system : lando
2019-04-26 20:29:30 +00:00
Masayuki Nakano 0986fb819b Bug 1542506 - Make nsDocShell use mozilla::PresShell* directly rather than nsIPresShell* r=bzbarsky
This patch makes `nsDocShell::GetPresShell()` and
`nsDocShell::GetEldestPresShell()` return `mozilla::PresShell*` and
some non-public methods use `mozilla::PresShell*` directly.

Differential Revision: https://phabricator.services.mozilla.com/D26424

--HG--
extra : moz-landing-system : lando
2019-04-13 01:03:13 +00:00
Masayuki Nakano 4204b59128 Bug 1540963 - Make nsIControllerCommandTable builtinclass and make its users use nsControllerCommandTable directly r=bzbarsky
`nsIControllerCommandTable` isn't implemented with JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, it's inherited only by nsControllerCommandTable.  So, all users
in C++ can treat the concrete class directly.

Differential Revision: https://phabricator.services.mozilla.com/D25727

--HG--
extra : moz-landing-system : lando
2019-04-03 12:52:14 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Boris Zbarsky 6d1f77b386 Bug 1534370 part 2. Annotate doCommand as MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D23041

--HG--
extra : moz-landing-system : lando
2019-03-12 01:57:42 +00:00
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Masayuki Nakano 6e11a1ab32 Bug 1505668 - part 3: Stop supporting "cmd_copyAndCollapseToEnd" since only CopyPasteAssistent refers it but nobody uses it r=m_kato,TYLin
"cmd_copyAndCollapseToEnd" is referred only by CopyPasteAssistent (even
including comm-central and BlueGriffon), but CopyPasteAssistent won't receive
"copy" command to send it.

So, it seems that we can get rid of a lot around CopyPasteAssistent but this
patch just changes the mapping in it ("copy" is mapped to "cmd_copy") and
removes command handlers of "cmd_copyAndCollapseToEnd" completely.

Differential Revision: https://phabricator.services.mozilla.com/D20612

--HG--
extra : moz-landing-system : lando
2019-02-22 01:39:14 +00:00
Masayuki Nakano dbf1103279 Bug 1525162 - Make nsClipboardCommand::IsCommandEnabled() check whether window has document before accessing the document r=smaug
nsClipboardCommand::IsCommandEnabled() accesses document without null-check.
That must be the cause of the reported crash.  This patch just adds the check.

Differential Revision: https://phabricator.services.mozilla.com/D19594

--HG--
extra : moz-landing-system : lando
2019-02-13 00:11:03 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano 7581aff013 Bug 1450882 - part 4: Make C++ users of nsICommandParams use nsCommandParams directly r=Ehsan
nsICommandParams is implemented only by nsCommandParams.  So, all C++ users
can treat all instances of nsICommandParams as nsCommandParams.  Therefore,
this patch makes all set/get value calls use non-virtual methods and all
constructors directly create nsCommandParams instance.

MozReview-Commit-ID: CscgK0gKp5g

--HG--
extra : rebase_source : 62eb0f60aada795a44cf5496cdafbff6cba80013
2018-07-10 20:04:21 +09:00
Masayuki Nakano 5a2332692a Bug 1450882 - part 2: Make nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue() treat nsACString instead of char r=Ehsan
nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue()
treat char.  However, this makes their callers complicated.  So, they should
be rewritten as treating nsACString.

MozReview-Commit-ID: DWO9veSyzyG

--HG--
extra : rebase_source : fbea13f6d7116ea1887434c0842b7768a7dc59ec
2018-07-10 18:04:46 +09:00
Boris Zbarsky b47b72dae9 Bug 1387143 part 23. Remove nsISelection collapse* methods. r=mats 2018-05-08 13:52:41 -04:00
Boris Zbarsky 25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky dac6314cb8 Bug 1456588 part 2. Change nsIFocusManager::MoveFocus to take Element. r=enndeakin 2018-04-26 10:37:47 -04:00
Gijs Kruitbosch 1f9f49c09b Bug 1446522 - don't return NS_ERROR_FAILURE for cut/copy/paste even when there's no selection, r=enndeakin+6102
MozReview-Commit-ID: AhToM4sAjJn

--HG--
extra : rebase_source : 5ec00b9dbeff4c5e8c557bab78a9bed618130391
2018-03-26 20:18:05 +01:00
Narcis Beleuzu 00fbf95c3b Backed out changeset baf5f1356969 (bug 1446522) for clipboard failures on /test_bug1012662_noeditor.html. CLOSED TREE 2018-03-28 14:25:57 +03:00
Gijs Kruitbosch a140dc6382 Bug 1446522 - don't return NS_ERROR_FAILURE for cut/copy/paste even when there's no selection, r=enndeakin+6102
MozReview-Commit-ID: AhToM4sAjJn

--HG--
extra : rebase_source : 83b5b97fc8ca0aa264c313953d3cd82014675f7b
2018-03-26 20:18:05 +01:00
Masayuki Nakano ec04470e25 Bug 1448876 - Get rid of nsIClipboardDragDropHooks and nsIClipboardDragDropHookList interfaces r=bz
nsIClipboardDragDropHooks and nsIClipboardDragDropHookList allow XUL apps
to customize drag and drop operation and paste operation.  However, this
feature was used only by ChatZilla and it doesn't work on Gecko anymore.
So, we can get rid of them from our tree.

MozReview-Commit-ID: Ibs3V1gI8Ry

--HG--
extra : rebase_source : 83428293d59aaca432d76c71b214aa7799f7f9de
2018-03-26 23:56:53 +09:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Jonathan Kew 1a613e00cb Bug 1424898 - patch 2 - De-virtualize nsIWordBreaker and rename to mozilla::intl::WordBreaker. r=m_kato
--HG--
rename : intl/lwbrk/nsSampleWordBreaker.cpp => intl/lwbrk/WordBreaker.cpp
rename : intl/lwbrk/nsIWordBreaker.h => intl/lwbrk/WordBreaker.h
2017-12-13 22:17:38 -06:00
Nicholas Nethercote 025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Ryan Hunt fb04e72bad Bug 1351783 part 19 - Rename Keyboard.h to KeyboardMap.h. r=masayuki
This is a better name for the header that matches its main class.

MozReview-Commit-ID: KSt9LVT3yRR

--HG--
rename : gfx/layers/apz/src/Keyboard.cpp => gfx/layers/apz/src/KeyboardMap.cpp
rename : gfx/layers/apz/src/Keyboard.h => gfx/layers/apz/src/KeyboardMap.h
extra : rebase_source : ec4c9ec5afa8479dc4cd3e987fc3293f047beb9e
extra : histedit_source : caa3a11043fc1ccdff3d7853eda69a0a3dfff99e
2017-06-15 18:06:00 -04:00
Ryan Hunt a97d402536 Bug 1351783 part 3 - Add a KeyboardScrollAction type. r=kats,masayuki
The different types of keyboard scrolls are represented as command strings that
are dispatched to nsGlobalWindowCommands. This commit adds a class to represent
these command strings, along with a function to find the keyboard scroll action
corresponding to a command string.

MozReview-Commit-ID: 20vvYdzlYYT

--HG--
extra : rebase_source : 8a965429f57534ac65da597cbb05a08284f7eaeb
2017-06-05 18:17:30 -05:00
David Major 940f1b7413 Bug 1335207 followup build fix on a CLOSED TREE
MozReview-Commit-ID: HPhI9ngjcSj
2017-02-01 16:09:28 +13:00
David Major c45f3a66c0 Bug 1335207: Add constexpr to data tables under dom/ for better codegen on Windows. r=ehsan
MozReview-Commit-ID: 6tEIqjq4Guo
2017-02-01 15:42:33 +13:00
Masayuki Nakano d960ef26d5 Bug 1278014 part.5 Rename SelectionType::SELECTION_NORMAL to SelectionType::eNormal r=smaug
MozReview-Commit-ID: AAdxTTKEvrk

--HG--
extra : rebase_source : 82e10db6b8b17d4f571625e34bb3c8f1905ef58a
2016-06-09 18:35:22 +09: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
Makoto Kato 04efbe5905 Bug 1177943 - Part 2. Add cmd_lookUpDictionary content command. r=masayuki
To get selected word on contnet process, I create new contnet command to look up dictionary.  Then, call nsIWidget's method to show looking up dictionary.

About fetched length, see https://www.chromium.org/developers/design-documents/system-dictionary-pop-up-architecture for OSX 10.6's design

MozReview-Commit-ID: Ic2r6hboEEw
2016-05-02 11:41:20 +09:00
Michael Layzell d09810392d Bug 1208217 - Enable paste event listener in documents with no editor component, r=enndeakin 2016-05-16 18:09:41 -04:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Birunthan Mohanathas b568910a25 Bug 1217307 - Remove some unnecessary null checks in dom/base/. r=njn 2015-11-19 09:13:49 +02:00
Masayuki Nakano 08fd7190da Bug 895274 part.117 Rename NS_CUT to eCut r=smaug 2015-09-08 23:33:35 +09:00
Masayuki Nakano 983ec22e88 Bug 895274 part.116 Rename NS_COPY to eCopy r=smaug 2015-09-08 23:33:34 +09:00
Masayuki Nakano 0d22745cda Bug 895274 part.3 Make the enum of event messages a named enum IGNORE IDL r=smaug 2015-08-26 21:56:59 +09:00
Birunthan Mohanathas 7315345693 Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Michael Layzell 0f9ea8b283 Bug 1170531 - Disable clipboard menu commands correctly in non-(X)HTML documents; r=ehsan 2015-06-30 08:18:04 -04:00